def get_menu(self):
"""Create and populate the menu."""
menu = Gtk.Menu()
self.pomodoro_start = Gtk.MenuItem.new_with_label(_('Start'))
self.pomodoro_start.connect('activate', self.on_pomodoro_start)
self.pomodoro_start.show()
menu.append(self.pomodoro_start)
self.pomodoro_restart = Gtk.MenuItem.new_with_label(_('Re-start'))
self.pomodoro_restart.connect('activate', self.on_pomodoro_restart)
self.pomodoro_restart.show()
menu.append(self.pomodoro_restart)
separator1 = Gtk.SeparatorMenuItem()
separator1.show()
menu.append(separator1)
#
menu_preferences = Gtk.MenuItem.new_with_label(_('Preferences'))
menu_preferences.connect('activate', self.on_preferences_item)
menu_preferences.show()
menu.append(menu_preferences)
menu_help = Gtk.MenuItem.new_with_label(_('Help'))
menu_help.set_submenu(self.get_help_menu())
menu_help.show()
menu.append(menu_help)
#
separator2 = Gtk.SeparatorMenuItem()
separator2.show()
menu.append(separator2)
#
menu_exit = Gtk.MenuItem.new_with_label(_('Exit'))
menu_exit.connect('activate', self.on_quit_item)
menu_exit.show()
menu.append(menu_exit)
#
menu.show()
return(menu)
评论列表
文章目录