[Glade-devel] I'm back.
paolo borelli
pborelli@katamail.com
25 Jun 2003 17:22:14 +0200
Disclaimer: I haven't looked at your changes yet.
On Wed, 2003-06-25 at 00:18, Joaquin Cuenca Abela wrote:
> > The best solution IMHO is to make GladePlaceholder a
> > GladeWidget and include it in the tree structure instead of
>
> I don't quite agree. GladePlaceholder is a GtkWidget, so if you want to
> also make GladePlaceholder a GladeWidget, then GladeWidget should also
> be GtkWidget, and that doesn't makes sense.
>
I don't understand why GladeWidget should be a gtkWidget... we have
GladeWidget->widget which is the actual gtk widget; in my proposal also
the placeholders have a GladeWidget associated with them where the
GladeWidget->widget is what the placeholder is now. This way the tree
data structure implemented by GladeWidget->parent and
GladeWidet->children would be a complete memory representation of our
xml structure (at each node in the xml - be it a widget or a placeholder
- would be represented by a GladeWidget: eg a vbox with 3 slots in which
the second one contains a button would be a GladeWidget with 3 children
GladeWidgets, one where GladeWidget->widget is a button and the other
two where ->widget is a placeholder)
Not that it matters much. While I was talking you did the code so you
are right by definition :)
> What I was thinking is instead to just change the logic of
> glade_widget_write.
> Right now, it looks on the list of childrens of the GladeWidget.
> Instead, look at the list of children of the GtkWidget with
> gtk_container_get_children (only if it's a container), and then for each
> children, we have 3 possibilities:
>
> 1) it's a widget with an associated GladeWidget
> 2) it's a placeholder
> 3) neither of these
>
> In case 1, we just keep with the current logic (redoing
> glade_widget_write, etc.), in case 2, we print the <placeholder/>, and
> in case 3, we just ignore the widget.
>
I should look at your changes before writing this (I'll do asap), but
does the above mean that we can get rid of our tree structure
completely?
If that's the case we've somewhat reversed the design of how things
works: we used to have our tree of gladeWidgets which was the main data
structure and each gladeWidget had a gtkWidget associated to it; now our
main structure its determined by how each gtkWidget it's contained by
another and for each gtkWidget we retrieve the associated GladeWidget to
get some info.
I'm not saying that it's better or worst I'm just trying to understand
wehere we're heading.
> I've coded it & committed. The only that I'm lacking is printing the
> packing properties of the placeholder, I will do it tomorrow if nobody
> beats me. Btw, we should also not print a property if it's equal to the
> default value, as right now we're quite verbose.
>
Do we really need packing properties for a placeholder? AFAICS glade-2
just put
<child>
<placeholder/>
</child>
which after all makes sense, since the packing properties of a
placeholder are always the default ones since you can't edit them. Or am
I missing something?
ciao
paolo