[gtkada] limiting the scope of mnemonics

Stephen Leake stephen_leake at acm.org
Tue Aug 10 02:43:53 CEST 2004


I'm developing a GUI interface to a books database. There are several
tables (author, title, etc), so I have a root Table_View widget, with
buttons for Add, Delete, etc. There are two instances of this widget,
one for Author, one for Title.

Thus there are two Add buttons. If I use mnemonics
(Gtk.Button.Gtk_New_With_Mnemonic), Alt-a is bound to both Add
buttons, which isn't what I want.

Mnemonics are local within a top-level window. Is there any way to
'localize' the mnemonics further? So if Author and Title are both
within the same top-level window, and the focus is in any widget
that is a child of Author, Alt-a activates Author's Add, and if the
focus is in a child of Title, Alt-a activates Title's Add.

That's the way the Win32 MDI works. I've tested GtkAda.MDI, and it
doesn't work this way; if the focus is in Title, Alt-a can activate
the Add in Author. So my current work-around is to have a top-level
window for each table, which I think is ugly. But that does seem to be
the Gtk style; GIMP has several small top-level windows.
 
There's very little on mnemonics in the Gtk user manual.

-- 
-- Stephe




More information about the gtkada mailing list