Re: menu accelerators not working



jcupitt gmail com wrote:
On 10/30/07, Philip Tricca <phil noggle biz> wrote:
I'm using the GtkUIManager to build my menus from GtkActionEntrys and
an
xml description.  Everything works great except for the accelerators.
I
can't seem to get them working at all, even the stock quit.

Have you added the accel group to the window? You need:

        accel_group = gtk_ui_manager_get_accel_group( mainw->ui_manager );
        gtk_window_add_accel_group( GTK_WINDOW( mainw ), accel_group );

For example, search in:

http://vips.svn.sourceforge.net/viewvc/vips/nip2/trunk/src/program.c?view=markup

for accel for some boilerplate.

Thanks John,  That's huge!!

I pulled down a few examples but they were all using glade. Your recommendation and your reference code has been a huge help. The GtkAccelGroup makes a bit more sense now, especially after seeing that it needs to be directly associated with the top level window. The GtkUIManager can make them but can't make the final connection to the top level window on its own.

Thanks,
- Philip


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]