[Glade-devel] I'm back.



On Tue, 2003-06-24 at 04:39, Archit Baweja wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hey guys

Well with school over for the summers, I've got time on my hands. So how about
some thing to work on. Anything lacking in glade3 that might need attention?


Great to have you working on glade3 again!

Some of the things that come to my mind are:

1 - make all the widgets work (for example GtkNotebook and gtkFixed);
this requires some discussion because we don't have a well defined way
to handle widgets which have other widgets inside: e.g. the label of the
tab of a notebook, in glade-2 a gtklabel is created and substituted to
the automatic tab label so that the user can actually select the tab,
delete it and put another widget there (in other words in the xml file
there is actually a label child). Another example of this kind of issue
is the viewport inside a scrolled window: when do we add it? AFAIK a
viewport is necessary to add a button to the scrolled window, on the
other hand a treeview does not need one.

2 - a more gui oriented thing to work on, is to finish porting the menu
editor and if possible convert it to GtkTreeView.

3 - handle the placeholder tag properly: IMHO this is biggest problem
right now. I think I have understood the problem but fixing it requires
quite a bit of changes and I haven't come to a working solution.
Explanation of what I found follows for those who want to give it a shot
(note however that maybe I'm totally wrong...)
The problem is that we don't have placeholders in our main tree
structure (the one made of GladeWidget->parent and
GladeWidget->children) so when we save a file to xml we don't generate
the <placeholder> tags. This screws various things, first of all the
compatibility with glade-2, but also other things: for example try to
create a window, add a vbox to it, add a button to the second slot of
the vbox, save the file and exit... now reopen glade-3 and open that
file: the button will be at the wrong place.
The best solution IMHO is to make GladePlaceholder a GladeWidget and
include it in the tree structure instead of making it a special case.
But how?
The more radical solution would be to make GladeWidget a GObject instead
of a simple structure, but I'm not sure that it makes sense. In this
case GladePlaceholder would be a subclass of GladeWidget.
Another approach (the one I tried, without finishing it) is to make
glade_placeholder_new return a GladeWidget, something like:

GladeWidget *
glade_placeholder_new (GladeWidget *parent)
{
        GladeWidget *widget;

        widget = g_new0 (GladeWidget, 1);
        widget->name       = g_strdup ("placeholder");

        /* this is more or less what the current placeholder is */
        widget->widget     = glade_placeholder_create_gtk_widget;
 
        widget->project    = parent->project;
        widget->class      = NULL; /* FIXME: how I handle this? */
        widget->properties = NULL;
        widget->parent     = parent;
        widget->children   = NULL;

        return widget;
}

Anyway also with this less radical way a lot of things must be changed:
all the use of placeholder must be audited because it's no more a simple
gtkWidget, the same goes for all the use of the widget->children list
which didn't include the placeholder before.
An alternative way to try to fix the problem would be to keep the
placeholder a gtkwidget like it is now, and make the widget->children
list contain both pointers to GladeWidget and pointers to placeholders;
this may require less changes at first, but I didn't like the idea very
much.

As I said I tried to fix this problem one afternoon, but after a while I
kept doing "only just one more change" and ended up with something far
from compilable ;) so if someone want to try to fix it, be my guest!


This are the first three things that come to my mind, but I'm sure you
can think of a lot more :)

...did you really read till this point? Wow, I can't understand why I'm
so verbose by mail, I swear that usually I'm not ;)

ciao
        paolo






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]