GNOME Bugzilla – Bug 163322
GtkToolbars in old GTK+ 2.0 format no longer work
Last modified: 2005-02-12 01:22:15 UTC
It looks like the old-style GTK+ 2.0 toolbars are not loaded correctly any more. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=288445 (and also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=287167) It seems to have happened between 2.4.0 and 2.4.1. Is libglade supposed to be backwards compatable to 2.0? I would think so, but I'm not sure.
Fle chooser dialog also not working in 2.4.1 To reproduce: 1. Create a glade file with just one File Chooser Dialog http://baijum81.freezope.org/tmp/fcd.glade 2. I run this like : import gtk import gtk.glade gtk.glade.XML('fcd.glade') gtk.main() 3. Now Cancel and Open buttons are not visible. >>> import gtk >>> import gtk.glade >>> t=gtk.glade.XML('fcd.glade') >>> type(t.get_widget('fcd')) <type 'gtk.FileChooserDialog'> >>> type(t.get_widget('dialog-vbox1')) <type 'NoneType'> >>> type(t.get_widget('dialog-action_area1')) <type 'NoneType'> >>> type(t.get_widget('button1')) <type 'NoneType'> >>>
It seems that the bug actually relates the toolbar inside the bonobo dock. I have composed a few testcases demonstrating that for a pure gtk both old way ('button') and new way ('GtkToolButton') work just fine. However, when the window is a GnomeApp and the toolbar is inside the bonobo dock item, then the old way no longer works. Attaching testcases in a minute, Alex
Created attachment 36264 [details] gtk_old.glade old toolbar API, pure gtk, glade file
Created attachment 36265 [details] gtk_old.py old toolbar API, pure gtk, python code (to use with gtk_old.glade)
Created attachment 36266 [details] gtk_new.glade New toolbar API, pure gtk, glade file
Created attachment 36267 [details] gtk_new.py New toolbar API, pure gtk, python code (to use with gtk_new.glade)
Created attachment 36268 [details] gnome_old.glade Old toolbar API, gnome, glade file
Created attachment 36269 [details] gnome_old.py Old toolbar API, gnome, python code (for use with gnome_old.glade)
Created attachment 36270 [details] gnome_new.glade new toolbar API, gnome, glade file
Created attachment 36271 [details] gnome_new.py new toolbar API, gnome python code (for use with gnome_new.glade)
Summary of the testcases: 1. Both $ python gtk_new.py and $ python gtk_old.py display toolbar with the button. 2. Running $ python gnome_new.py does display a proper toolbar with the button, while $ python gnome_old.py display an empty toolbar, no button. Seems that the bug needs to be moved from gtk to bonobo component, but I do not have permissinos to change this.
With test-libglade the toolbar button is also invisible in gtk_old.py. So I still think it is a libglade toolbar problem.
What's the test-libglade?
It's a small test app included with libglade.
I can reproduce the test results of Alex Roitman. This has resulted in a release critical bug fo libglade2 in Debian, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=290811. As I am the Debian maintainer of libglade, I would really appreciate upstream to comment on this, since I will most likely have to revert the changes, thus becoming incompatible with upstream. As the change of the toolbar API used effectivly changes the ABI of libglade2, this change should have never happened during a stable release series.
I agree that the recent changes to toolbar_build_children() should be reverted. (I'd revert the entire function to the 2.4.0 code, except to use gtk_container_add() instead of gtk_toolbar_append_widget() at the end.) Is there any particular reason it was changed to use the new API?
FWIW, note that there is a patch that is supposed to fix this (by reverting the offending change) in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=290811.
Sorry about not handling this sooner. I've put out a new release that corrects the problem with libglade-2.4.1 (not a complete revert, since 2.4.1 also fixed a problem handling the "active" property for radio toolbar items). It should fix all programs that broke with 2.4.1 though.