GNOME Bugzilla – Bug 145299
Internal children break GladeProjectView in tree mode
Last modified: 2004-12-22 21:47:04 UTC
Steps to reproduce: 1. Open the Widget Tree 2. Create a Dialog The problem is that the glade_gtk_dialog_post_create() function creates two internal GladWidget (one for the action area and one for the vbox) and when adding these widgets to the project the Widget Tree (GladeProjectView) tries to add them to the model but as the parent widget (the dialog) is not yet in the model they can not be added properly. I've implemented a fix for my python clone and you can see it at http://www.sicem.biz/viewsvn/pyglade/projectview.py?view=auto&rev=409 see the add_item method.
Whew, I have a patch after much treeview lore learned, I will submit after my last uber-ultra-huge patch gets commited and synced to anoncvs.
Created attachment 33936 [details] [review] This fixes this bug, and a bunch more. True to the tradition, here are the changelog entries: 2004-11-19 Tristan Van Berkom <tristan.van.berkom@gmail.com> * src/glade-catalog.c: pallet_name is no longer "required" in the catalog, if it is present, then the widget goes in the pallet, if there is a generic name, it will be used in the case of non-widgets. * src/glade-command.c: glade_command_create no longer nescesitates a placeholder and now has a "parent" argument for the case of (!toplevel && non-widget) (surrounding code adjusted to work with non-widgets, glade_command_delete stuff included). * src/glade-editor.c: - Widget page is now called General page - Name field not appended to non-widgets * src/glade-gtk.c: GtkFixed code fixed to not needlessly create placeholders at child create time (go directly to glade_command_create() without passing go or collecting 200 dollars). * src/glade-placeholder.c: Use new glade_command_create () * src/glade-popup.c: - Added code needed for addition of non-widgets. - Added "add_children" arg to glade_popup_widget_pop () * src/glade-project-view.c: - fixed bug 145299. - Added popup code to treeview. * src/glade-project-window.c: Fixed some error messages, used new glade_command_create() * src/glade-property.c: Fixed a bug in rebuilding of widgets (project list needs to be searched to find out if the widget is actualy in the project). * src/glade-utils.c: glade_utils_draw_nodes_idle(), dont try to draw nodes on non-widgets. * src/glade-widget-class.[ch]: Added glade_widget_class_get_by_type () * src/glade-widget.c: Added glade_widget_sync_packing_props () and glade_widget_set_parent ().
Oops, I broke something in glade_command_create () whild trying to cleanup the g_return_if_fail stuff, will send a replacement patch momentarily...
Created attachment 33946 [details] [review] Replacement fix patch Here, this is a little better ;-)
Created attachment 34331 [details] [review] Patch is getting quite big now This is the latest take on non-widgets, they work seemlessly for me (unfortunatly I havent implemented any objects from native gtk yet but the support is there). Here is the updated changelog entry: * src/glade-catalog.c: pallet_name is no longer "required" in the catalog, if it is present, then the widget goes in the pallet, if there is a generic name, it will be used in the case of non-widgets. * src/glade-command.c: glade_command_create no longer nescesitates a placeholder and now has a "parent" argument for the case of (!toplevel && non-widget) (surrounding code adjusted to work with non-widgets, glade_command_delete stuff included). * src/glade-editor.c: - Widget page is now called General page - Name field not appended to non-widgets - Adjusted text inputs to only set properties on TAB or ENTER (or focus changes in the case of multi line entries) This heavily reduces spamming of the property system as properties dont get synchronized for every single charachter change. * src/glade-gtk.c: GtkFixed code fixed to not needlessly create placeholders at child create time (go directly to glade_command_create() without passing go or collecting 200 dollars). (Also fixed name of enum type glade_gtk_stock_get_type) * src/glade-placeholder.c: Use new glade_command_create () * src/glade-popup.c: - Added code needed for addition of non-widgets. - Added "add_children" arg to glade_popup_widget_pop () * src/glade-project-view.c: - fixed bug 145299. - Added popup code to treeview. * src/glade-project-window.c: Fixed some error messages, used new glade_command_create() * src/glade-property.c: Fixed a bug in rebuilding of widgets (project list needs to be searched to find out if the widget is actualy in the project). * src/glade-property-class.c: Made custom props load tooltips from pspec blurbs as well as the xml file. * src/glade-utils.c: - glade_utils_draw_nodes_idle(), dont try to draw nodes on non-widgets. - added glade_util_widget_pastable() - added glade_util_gtkcontainer_relation() * src/glade-widget-class.[ch]: - added glade_widget_class_get_by_type () - added glade_widget_class_get_derived_types () * src/glade-widget.c: - added glade_widget_sync_packing_props () - added glade_widget_set_parent (). - Made widgets parent a property of widget - glade_widget_new() now takes a "parent" argument. - removed glade_widget_update_parent() which was more confusing than anything else.
Patch applied on LIBGLADE_INTEGRATOIN branch.