[prev in list] [next in list] [prev in thread] [next in thread]
List: gtk-app-devel
Subject: Re: Accelerator keys and popup menus?
From: Stefan Kost <ensonic () hora-obscura ! de>
Date: 2007-08-21 19:04:57
Message-ID: 46CB3759.5040302 () hora-obscura ! de
[Download RAW message or body]
hi,
Gabriel Schulhof wrote:
> Hi!
>
> On Sun, 2007-08-19 at 23:48 +0300, Stefan Kost wrote:
>> I read about the differences. I really want "accelerators".
> I was able to hack it:
>
> Create a plain old regular menubar-type menu with accelerators. Then ref
> the submenu you want to make into a popup menu and detach it from its
> parent menu item[0].
>
> [0]http://library.gnome.org/devel/gtk/unstable/GtkMenuItem.html#id3734460
>
> HTH,
>
> Gabriel
>
like this?
// generate the context menu
GtkWidget *mb=gtk_menu_bar_new();
GtkWidget *mi=gtk_menu_item_new();
gtk_container_add(GTK_CONTAINER(mb),mi);
self->priv->context_menu=GTK_MENU(gtk_menu_new());
gtk_menu_set_accel_group(GTK_MENU(self->priv->context_menu),
self->priv->accel_group);
gtk_menu_set_accel_path(GTK_MENU(self->priv->context_menu),"<Buzztard-Main>/PatternView/PatternContext");
gtk_menu_item_set_submenu(GTK_MENU_ITEM(mi),GTK_WIDGET(self->priv->context_menu));
g_object_ref(self->priv->context_menu);
gtk_menu_detach(self->priv->context_menu);
make no difference for me :/
I also tried
gtk_menu_attach_to_widget(self->priv->context_menu,
GTK_WIDGET (main_window),NULL);
Stefan
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic