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 118036 - Label accelerators set in libglade are lost if widgets are reparented.
Label accelerators set in libglade are lost if widgets are reparented.
Status: RESOLVED WONTFIX
Product: libglade
Classification: Deprecated
Component: gtk
0.x
Other Linux
: Normal normal
: ---
Assigned To: James Henstridge
James Henstridge
Depends on:
Blocks:
 
 
Reported: 2003-07-22 03:23 UTC by Christian Reis (not reading bugmail)
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Reis (not reading bugmail) 2003-07-22 03:23:28 UTC
All label accelerators set in libglade are lost when the relevant widgets
are reparented. The testcase is simple:

  t = glade.GladeXML('foo.glade') # where foo an accel label (underscored)
  w = t.get_widget("window")
  w.show_all()
  
At this point the accelerator works fine.

  w2 = gtk.GtkWindow()
  w.children()[0].reparent(w2)

Here, all accelerators stop working.

I'm not entirely sure how this should be fixed; a quick glance at the
libglade code didn't give me any late-night insights. I know this version
is old and not maintained, but:

  - Does this bug happen in CVS HEAD libglade too?
  - Any hints as to how I could work around this problem? C extension
hacking is an acceptable compromise at this point :-/
Comment 1 Christian Reis (not reading bugmail) 2003-07-22 03:24:59 UTC
Just as a data point, Kiwi uses reparenting extensively in its "slave"
system, which are really groups of widgets that are embedded in other
windows (they have a temporary toplevel window only for reparenting
purposes).
Comment 2 James Henstridge 2003-07-22 05:18:35 UTC
Keyboard shortcuts are handled by GtkAccelGroups, which are attached
to top level windows.

When you reparent all the widgets into a new toplevel, the new
toplevel doesn't have the accel group attached to it, so the keyboard
shortcuts won't work.  (however, they should still function if you
press them in the original toplevel, assuming it is visible :)

For GTK 2, mnemonics (alt+letter shortcuts) are handled specially and
don't suffer from this problem.
Comment 3 Christian Reis (not reading bugmail) 2004-03-06 16:46:42 UTC
There's a workaround which is grabbing the accelerators from the
original window and attaching them to the new window, which works as
expected (though the hard part is figuring out how to organize
accelerators correctly, particularly for GtkNotebook which is handled
specially inside libglade). I'm closing this since it's only an issue
in GTK+ 1.2 with an acceptable workaround.