hi, more research and a standalone test (attached and via web [1]). The good news are that gtk+ supports multiple accel maps and that those can be even dynamically switched (activated/deactivated). The issue seems that a new accel_map needs to be added to the window before adding any accelerators. If one only adds it later, it has no effect. I have not yet managed to figure out what is causing the difference.
The problem for me is that when I construct my ui I use lots of g_objects which init children while they are initialized. As such one cannot yet query the window from deep within the hierarchy :/ and passing the window down the call hierarchy is out of question. Stefan [1] http://buzztard.cvs.sourceforge.net/buzztard/buzztard/design/gui/accelpopup.c?view=markup Stefan Kost wrote: > Hi, > > Dunno if this is a bug/limmitation in gtk+. I now moved the > GtkAccelGroup to my ui-resource singleton and it works. That means I use > only *one* accel_group. > I have a toplevel window with views (tabs). Before I was creating a > separate one for my popup menu and adding/removing to the window > depending on which tab was visible. Seems that gtk+ is only supporting > one accel_group. > > Stefan > > Quoting Stefan Kost <[EMAIL PROTECTED]>: > >> 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 >> > >
_______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list