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 129846 - libglade: GtkMenuItem accelerators lost during reparenting
libglade: GtkMenuItem accelerators lost during reparenting
Status: RESOLVED WONTFIX
Product: libglade
Classification: Deprecated
Component: gtk
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2003-12-22 16:42 UTC by Roger Leigh
Modified: 2011-07-20 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase -- code (1.95 KB, text/plain)
2003-12-22 16:43 UTC, Roger Leigh
Details
testcase -- glade interface (4.77 KB, text/plain)
2003-12-22 16:44 UTC, Roger Leigh
Details
accelerator-example.glade (5.74 KB, application/xml)
2004-01-02 13:42 UTC, Roger Leigh
Details
New testcases with libglademm libglade and libgtk (3.94 KB, application/x-compressed-tar)
2004-10-16 15:16 UTC, Roger Leigh
Details

Description Roger Leigh 2003-12-22 16:42:47 UTC
If you create a menubar by hand or with libglade, everything works OK.
The problem arises when you reparent with
Gnome::Glade::Xml::reparent_widget().  This "loses" the accelerators.

I've tried various things: adding an accel group to the main window,
and then calling Gtk::MenuShell::accelerate(Gtk::Window&), but this
doesn't have an effect.

I'm sure this is caused by reparenting.

I'm not sure if it's possible to attach files to a bug report.
The testcase is archived on the gtkmm-list, Subject is
"Re: [gtkmm] Menus and libglademm", Message-ID is
"<87brq8nz1x.fsf@wrynose.whinlatter.uklinux.net>".
Comment 1 Roger Leigh 2003-12-22 16:43:27 UTC
Created attachment 22644 [details]
testcase -- code
Comment 2 Roger Leigh 2003-12-22 16:44:11 UTC
Created attachment 22645 [details]
testcase -- glade interface
Comment 3 Murray Cumming 2004-01-02 10:22:10 UTC
I tried this with the menus example, in libglademm/examples, and I
don't see any accelerators, and that doesn't even use the reparent
method. I can't even get it to work in C with libglade. Do you have an
example that does work, without reparenting, for comparison?
Comment 4 Roger Leigh 2004-01-02 13:42:39 UTC
Created attachment 22839 [details]
accelerator-example.glade
Comment 5 Roger Leigh 2004-01-02 13:45:58 UTC
I've attached a new Glade file, which adds a C+Q accelerator to the
menu_file_quit MenuItem.  This does work as expected, in that now
C+Q now causes the program to terminate.

This works with the normal gnomemm/libglademm/examples/menus/example
program.


Regards,
Roger
Comment 6 Murray Cumming 2004-01-11 18:41:33 UTC
So, the problem seems to be only with _stock_ accelerators. I still
have not found any example of this in C, however.
Comment 7 Roger Leigh 2004-01-15 15:52:34 UTC
> So, the problem seems to be only with _stock_ accelerators.
> I still have not found any example of this in C, however.

I'm not sure what you mean by a "stock accelerator".  The stock
MenuItem's don't have any accelerators??

I'll write an example in C, but I don't expect this to be a problem:
it works fine with a normal libglademm-loaded interface in C++.  The
problem only arises after the widgets have been reparented.

I have a copy of the gnomemm CVS now, so I'll have a look at it.


Comment 8 Murray Cumming 2004-01-20 18:35:41 UTC
> The stock MenuItem's don't have any accelerators??

Yes, they should. For instance, File/Save _should_ have a Ctrl-Save
accelerator without you specifying it explicitly.
Comment 9 Murray Cumming 2004-10-14 15:36:49 UTC
> I'll write an example in C

Roger?
Comment 10 Roger Leigh 2004-10-16 15:13:24 UTC
OK, I now have two examples in C, one using libglade and one plain libgtk.

It looks like it's actually a Glade or libglade issue: the libglade example
doesn't work either, but the gtk one does.  If the GtkAccelGroup for the created
menu is added to the (now non-existent) main window of the Glade interface, it
won't get owned by the window it's been reparented into without some magic.  The
same applies to loading an interface from some point other than the root (as in
these new examples).

There are also some warnings printed at program termination in the
libglademm-noreparent example.

So I think it's basically down to the handling of the GtkAccelGroup holding the
menu accelerators.  I'm afraid I'm not enough of a GTK+ internals expert to
debug that much further.

Regards,
Roger
Comment 11 Roger Leigh 2004-10-16 15:16:00 UTC
Created attachment 32672 [details]
New testcases with libglademm libglade and libgtk

New testcases.
Comment 12 Murray Cumming 2004-10-27 23:54:09 UTC
What type of file is that? It doesn't seem to be a .tar.gz. Please put the
filename in the description in future.
Comment 13 Roger Leigh 2004-10-28 17:42:14 UTC
The file is a .tar.bz2.

BTW, file(1) can tell you this:
$ file testfile
testfile: bzip2 compressed data, block size = 900k


Regards,
Roger
Comment 14 Roger Leigh 2004-10-30 21:51:01 UTC
I think this is a general issue with libglade AccelGroup handling rather than a
libglademm bug, and can probably be reassigned to libglade if you agree with the
testcase.

Regards,
Roger
Comment 15 Roger Leigh 2004-12-02 19:00:36 UTC
The basic problem lies with libglade, not libglademm, so I'm transferring it to
the "libglade" component.


Regards,
Roger
Comment 16 Roger Leigh 2005-10-03 20:53:50 UTC
Is there any progress being made on this bug?  Is there anything I can do to help?


Regards,
Roger
Comment 17 Fabio Durán Verdugo 2011-07-19 23:27:30 UTC
The GNOME Release team has officially deprecated libglade in favor of GtkBuilder[1]. So it's unlikely to get further development. I am closing bugs as WONTFIX. Please feel free to reopen the bugs in future if anyone takes the responsibility for active development.

[1] http://permalink.gmane.org/gmane.comp.gnome.devel.announce/28
Comment 18 Roger Leigh 2011-07-20 18:19:28 UTC
Did you check if the bug was still present in GtkBuilder?  Last time I checked, it still had numerous issues.