def activate(self,shell):
self.shell = shell
self.action = gtk.Action ('foo','bar','baz',None)
self.activate_id = self.action.connect ('activate', self.call_bk_fn,self.shell)
self.action_group = gtk.ActionGroup ('hot_key_action_group')
self.action_group.add_action_with_accel (self.action, "<control>E")
uim = shell.get_ui_manager ()
uim.insert_action_group (self.action_group, 0)
uim.ensure_update ()
def call_bk_fn(self,shell):
print('hello world')
我在节奏盒的插件中使用上面的代码,在这里我试图注册键 ctr+e 以便在按下组合键时调用 call_bk_fn ,但它不起作用为什么会这样?