After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 145299 - Internal children break GladeProjectView in tree mode
Internal children break GladeProjectView in tree mode
Status: RESOLVED FIXED
Product: glade
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks: 157473
 
 
Reported: 2004-07-02 09:29 UTC by Lorenzo Gil Sanchez
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This fixes this bug, and a bunch more. (34.55 KB, patch)
2004-11-19 15:39 UTC, Tristan Van Berkom
none Details | Review
Replacement fix patch (35.69 KB, patch)
2004-11-19 19:20 UTC, Tristan Van Berkom
none Details | Review
Patch is getting quite big now (74.46 KB, patch)
2004-11-30 18:51 UTC, Tristan Van Berkom
none Details | Review

Description Lorenzo Gil Sanchez 2004-07-02 09:29:05 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.
Comment 1 Tristan Van Berkom 2004-11-17 21:26:29 UTC
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.

Comment 2 Tristan Van Berkom 2004-11-19 15:39:40 UTC
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 ().
Comment 3 Tristan Van Berkom 2004-11-19 18:55:38 UTC
Oops, I broke something in glade_command_create () whild trying
to cleanup the g_return_if_fail stuff, will send a replacement patch
momentarily...
Comment 4 Tristan Van Berkom 2004-11-19 19:20:52 UTC
Created attachment 33946 [details] [review]
Replacement fix patch

Here, this is a little better ;-)
Comment 5 Tristan Van Berkom 2004-11-30 18:51:29 UTC
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.
Comment 6 Tristan Van Berkom 2004-12-19 02:30:28 UTC
Patch applied on LIBGLADE_INTEGRATOIN branch.