[Glade-users] Using Actions + MenuItems + Accelerators + AccelLabels



Hello.

I have a bunch of actions and a MenuBar. Every MenuItem in the MenuBar
has an associated action. I'm using "related action" and "use action
appearance" to connect the actions with the menu. Now I want to assign
some shortcut keys to each action. I haven't found a way to do that in
Glade, so I'm doing it with code. I'm creating an ActionGroup and then
adding each action to that group using add_action_with_accel. Then I
create an AccelGroup and assign each action to it using
action.set_accel_group and connect the accelerator using
action.connect_accelerator. After that, I add the AccelGroup to the
window using window.set_accel_group. This seems to work, when I press
the keyboard shortcut the action is activated, however, the menu item
does not show the AccelLabel indicating the accelerator for that item.
How do I achieve this? Is there an easier way?

I'm using PyGTK and glade 3.6.3

Manuel.




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