[Glade-users] Viewing custom widget sub-widgets in Glade tree-view



Hi,

as disscussed there : http://www.gtkforums.com/viewtopic.php?p=18030#18030

I've managed to make my sub-widgets appear where I wanted, in the treeview.

However, the treeview content will not be updated when I'll add new
seb-widget to my custom widget, or remove some from it.

I've been analzing and trying to reproduce some techniques that are used in
gtk widgets plugin code that we can find here :
http://git.gnome.org/browse/glade3/tree/plugins/gtk+/glade-gtk.c

I've been trying for several days but couldn't update the tree view.

I've implemented a plugin for glade, it provide (wired in the xml file) :
    post-create-function
    set-property-function
    get-internal-child-function
    get-children-function

I see that the get-internal-child-function is not even called by glade (then
I don't undersand when it should be called) but at the moment I implemented
get-children-function I started to see the subwidgets in the glade
tree-view.

I've been following advices given there :
http://www.mail-archive.com/gtk-app-devel-list at gnome.org/msg12349.html

I think I'm missing something simple as the gtk glade plugin code don't seem
too complicated but I can't find how it makes the sub-children updated in
the treeview.

When I load a gui built with glade and saved with modified number of
sub-widgets in my custom widget, I get the right count of sub-widgets in the
tree-view. Only modifying it will not update the tree-view.

My custom widget have two properties with widgets counts that will add or
remove widgets from the custom widget (in the widget code).
So in the plugin I've only added in post-create-function and
set-property-functino some way to call
glade_widget_adaptor_create_internal() on new digets added to the custom
widget.
It's the same function that is called in the two functions but it seem to
work only with post-create-function.

Any suggestion?

I'm not sure if that question is clear enough, but tell me if it's not.

Thanks for reading

Joel Lamotte.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20101004/748d3c15/attachment.html 




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