[gtkada] Accelerators and popup windows

Stefan Bellon sbellon at sbellon.de
Thu Mar 31 21:57:44 CEST 2005


I'm developing an application that can open several windows of the same
type. All those windows share the same popup menu. But when certain
menu items are clicked, the action is applied to the window the popup
menu was opened in because when the popup is opened, you can remember
the window.

Now, I'm adding accelerators in order to let the user assign shortcuts
to the menu items. However, when the user executes an action via a
shortcut and not via the menu itself, there's no obvious way to know to
which window the action should apply to.

Is there any Gtk way I'm overlooking how to handle accelerators in
popup menus of different windows of the same type? To take Gimp a
non-Ada example: If you press '+', exactly the window with the input
focus gets zoomed in.

So, how does Gimp do it? Does it check for the input focus? How is this
done? Or is there a simple other way I'm overlooking?

Thanks for any hints in advance.

-- 
Stefan Bellon



More information about the gtkada mailing list