Re: [gtk-list] Re: enter_notify_event and leave_notify_event on menus?



>  In my experience, kinda.  :)  In doing menus for AbiWord, we wanted
>  to trigger an update to the status bar (with contextual hints for
>  the currently selected menu item.  enter_notify_event seems ONLY
>  to work for mouse movement, but not keyboard traversal.  I poked
>  around a few other messages (overriding "draw" was my final solution
>  with a bit of cleanup on the menu unmap for stray messages), but it's
>  still not perfect.  I'm just adding a function, attaching it to "draw"
>  for the menu item, and if the state is prelight, doing my thing.

Eeeeeeeewwwwwwwwwwww, please don't do this.  This is a horrible hack.

Use the "select" and "deselect" signals from GtkItem (which is the
parent class of GtkMenuItem) when you want to update the status bar.

Of course, if you were using the Gnome libraries, all of this would be
handled automagically for you :-)

  Federico



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