sensitive actions (Hacking GIMP)
Jordan Stinson wrote:
Hi all,
I'm trying to figure out which menu items are sensitive. It looks to
me as though this property is usually changed when the ui manager
updates the actions groups which updates the actions. I'm adding some
additional items to the toolbox (as a test, I'm adding some layer
actions). At the time of the toolbox initialization, the actions that
i'm adding are all sensitive. The menu items that correspond to these
are not sensitive when i view them and there doesn't appear to be any
calls to the layer actions update function after I've initialized the
toolbox. Could someone tell me how the "sensitive" property is decided
initially for menu items if not by the action's "sensitive" property?
Also could someone tell me how actions and menu items are related?
Hopefully my questions are clear enough.
Hi Jordan
The sensitivity of menu items are updated in the callback specified in
the action_groups array in app/actions/actions.c. For example, the
sensitivity of Image menu items is updated in image_actions_update() in
app/actions/image-actions.c. This update mechanism is also used for
calculating the initial sensitivity of menu menu items.
A GtkAction is an entity that does something, and a menu is a way to
execute a GtkAction.
Also refer to my previous mail to you on this topic:
http://lists.xcf.berkeley.edu/lists/gimp-developer/2009-June/022495.html
Feel free to ask further questions if things are still unclear.
BR,
Martin