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)
评论列表
文章目录