GtkMenuItem sensitivity and accelerator callbacks



I have have some problems with menu item sensitivity and accelerator
callbacks in my application Dia. I have most operations in a pull-down
menu (like the Gimp). Some of the menu items in that menu are insensitive
when you pull it down depending on the state of the diagram. Stuff like:
Copy/Cut/Delete are only sensitive if some object is selected.

Now, these sensitivities are set by a call to
display_set_menu_sensitivity() just before the menu is poped-up each time
the right mouse button is pressed. This works great, until you try to use
the keyboard accelerators in the menu. These are of course also made
sensitive just like the menu items, but as the sensitivity is only changed
when pulling down the menu they don't work well if the diagram state is
changed and the menu hasn't been pulled down.

Anyone know of any solutions for this? (I'd rather not call
display_set_menu_sensitivity() after each change of diagram state) Is
there some way to get a callback before each accelerator callback?

/ Alex




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