[pygtk] UIManagers and accelerators

Pietro Battiston toobaz at email.it
Sat Jan 24 01:09:57 WST 2009


Il giorno ven, 23/01/2009 alle 16.53 +0100, Pietro Battiston ha scritto:
> I'm trying to smartly use ActionGroups and UIManagers to simplify my
> callbacks management, but I can't understand totally the logic behind
> them.
> 
> I define my actions in my gtk.ActionGroup, adding them with add_actions.
> At this point, I would like to just say "OK, every action has its
> accelerator defined; gtk.Window, just listen to them!". Instead, I found
> no way to do that (better than just:
> 
> self.accelgroup = gtk.AccelGroup()
> self.add_accel_group(self.accelgroup)
> 
> for action in actiongroup.list_actions():
> 	action.set_accel_group(self.accelgroup)
> 
> ).

Mmmh... it is worse than I thought: this workaround still doesn't work
for actions which don't have a proxy realized. It seems like the only
gtkish simple way to have keyboard shortcuts is to have proxies... is it
so? Not that I like emacs, but...


Pietro



More information about the pygtk mailing list