Re: dynamic accelerators

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

 



Holy crap!  This actually worked a charm!
wes

>
>    gtk_window_add_accel_group(GTK_WINDOW(editor->shell), editor->ag);
>
> where "editor->shell" in my case is a TOPLEVEL window.
>
> static GtkWidget *
> make_accel_menu_item(GtkWidget *menu, const gchar *text,
>                     const gchar *accel, GtkAccelGroup *ag)
> {
>    GtkWidget *mi;
>    guint key;
>    GdkModifierType mods;
>
>    mi = gtk_menu_item_new_with_mnemonic(text);
>
>    gtk_accelerator_parse(accel, &key, &mods);
>    gtk_widget_add_accelerator(mi, "activate", ag, key, mods,
>                               GTK_ACCEL_VISIBLE|GTK_ACCEL_LOCKED);
>    gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
>
>    return mi;
> }
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux