menu.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:gnome-hud 作者: hardpixel 项目源码 文件源码
def activate_menu_item(self, selection):
        if not selection:
            return

        action = self.menu_actions.get(selection, 'sys.quit')

        if 'sys.' in action:
            self.window.close()

        elif 'app.' in action:
            app_object = self.session.get_object(self.window.bus_name, self.window.app_path)
            app_iface = dbus.Interface(app_object, dbus_interface='org.gtk.Actions')

            app_iface.Activate(action.replace('app.', ''), [], dict())

        elif 'win.' in action:
            win_object = self.session.get_object(self.window.bus_name, self.window.win_path)
            win_iface = dbus.Interface(win_object, dbus_interface='org.gtk.Actions')

            win_iface.Activate(action.replace('win.', ''), [], dict())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号