python类STOCK_REMOVE的实例源码

practisesheetdlg.py 文件源码 项目:Solfege 作者: RannyeriDev 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def setup_toolbar(self):
        self.g_toolbar = Gtk.Toolbar()
        self.g_actiongroup.add_actions([
         ('Add', Gtk.STOCK_ADD, None, None, None, self.on_add_lesson_clicked),
         ('Remove', Gtk.STOCK_REMOVE, None, None, None, self.on_remove_lesson_clicked),
         ('Create', Gtk.STOCK_EXECUTE, _("Create Sheet"), None, None, self.on_create_sheet),
         ('Randomize', None, _("Randomize"), None, None, self.on_randomize),
        ])
        self.g_ui_manager.insert_action_group(self.g_actiongroup, 0)
        uixml = """
        <ui>
         <toolbar name='ExportToolbar'>
          <toolitem action='Add'/>
          <toolitem action='Remove'/>
          <toolitem action='New'/>
          <toolitem action='Open'/>
          <toolitem action='Save'/>
          <toolitem action='SaveAs'/>
          <toolitem action='Create'/>
          <toolitem action='Randomize'/>
          <toolitem action='Close'/>
          <toolitem action='Help'/>
         </toolbar>
         <accelerator action='Close'/>
         <accelerator action='New'/>
         <accelerator action='Open'/>
         <accelerator action='Save'/>
        </ui>
        """
        self.g_ui_manager.add_ui_from_string(uixml)
        self.vbox.pack_start(self.g_ui_manager.get_widget("/ExportToolbar"),
                             False, False, 0)
        self.g_ui_manager.get_widget("/ExportToolbar").set_style(Gtk.ToolbarStyle.BOTH)
trainingsetdlg.py 文件源码 项目:Solfege 作者: RannyeriDev 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def setup_toolbar(self):
        self.g_actiongroup.add_actions([
         ('Export', Gtk.STOCK_EXECUTE, _("Export"), None, None, self.on_export),
         ('Add', Gtk.STOCK_ADD, None, None, None, self.on_add_lesson_clicked),
         ('Remove', Gtk.STOCK_REMOVE, None, None, None, self.on_remove_lesson_clicked),
        ])
        self.g_ui_manager.insert_action_group(self.g_actiongroup, 0)
        uixml = """
        <ui>
         <toolbar name='ExportToolbar'>
          <toolitem action='Add'/>
          <toolitem action='Remove'/>
          <toolitem action='New'/>
          <toolitem action='Open'/>
          <toolitem action='Save'/>
          <toolitem action='SaveAs'/>
          <toolitem action='Export'/>
          <toolitem action='Close'/>
          <toolitem action='Help'/>
         </toolbar>
         <accelerator action='Close'/>
         <accelerator action='New'/>
         <accelerator action='Open'/>
         <accelerator action='Save'/>
        </ui>
        """
        self.g_ui_manager.add_ui_from_string(uixml)
        self.g_vbox.pack_start(self.g_ui_manager.get_widget("/ExportToolbar"),
                               False, False, 0)
        self.g_ui_manager.get_widget("/ExportToolbar").set_style(Gtk.ToolbarStyle.BOTH)


问题


面经


文章

微信
公众号

扫码关注公众号