looking for gtk_menu_get_current () or gtk_menu_get_focused ()



Hi,

In my key-press event handler attached to a menu, I need to know what
menu-item is current, focussed or highlighted so to say.

Asking for gtk_menu_get_active () seems to always returns the first
menuitem in this case; I assume because no menu item has been
activated/selected yet.

I'm not sure what the correct gtk+ jargon for this state
current/focused/selected/highlighted is, I find the api documentation
somewhat vague

   gtk_menu_get_active ()

   GtkWidget*  gtk_menu_get_active             (GtkMenu *menu);

   Returns the selected menu item from the menu.

Why would _active () return the 'selected' item?  I'd expect _selected ()
to return 'selected' item, and _active () to return the 'active' item.

   Returns : the GtkMenuItem that was last selected in the menu. If a
   selection has not yet been made, the first menu item is selected.

Also, I assume that `the first menu item is SELECTED' should read: the
first menu item is RETURNED?

Jan.

-- 
Jan Nieuwenhuizen <janneke gnu org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org



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