[Glade-users] Problem with menu accelerators in glade-2

Damon Chaplin damon@karuna.uklinux.net
Thu, 13 Mar 2003 21:05:13 +0000


On Fri, 2003-03-07 at 11:20, David Marín Carreño wrote:
 > Hi all.
 >
 > I'm using glade-2 for generating interfaces, using libglade2 while
 > executing.
 >
 > I've defined the main application window in a file called "main.glade",
 > and then, I'm defining different "component" interfaces in other
 > different glade files.
 >
 > I've defined a Menubar widget, with associated accelerator keys (as
 > Ctrl+N for "New", etc.), and another "component" widgets in a file
 > called "vat.glade"
 >
 > But when I launch the main window, loading the GladeXML object from
 > "main.glade" and I insert manually the widgets in "vat.glade" (after
 > loading them), the accelerator keys in the menubar don't work.

I think the problem is that the accelerator keys for your menuitems need
to be added to the toplevel window somehow (e.g. with
gtk_window_add_accel_group()). But I don't think libglade provides a way
to get the GtkAccelGroup that is used when creating "vat.glade".

It would be simpler if you just had the window & menubar in one XML
file.

I don't really understand the way accelerators are done in GTK+ 2, I'm
afraid, so can't help much.

Damon