def init_application(): """Initialise the standalone application.""" import gameMan global window window = TK_ROOT TK_ROOT.title( _('BEEMOD {} - Backup / Restore Puzzles').format(utils.BEE_VERSION) ) init() UI['bar'] = bar = tk.Menu(TK_ROOT) window.option_add('*tearOff', False) if utils.MAC: # Name is used to make this the special 'BEE2' menu item file_menu = menus['file'] = tk.Menu(bar, name='apple') else: file_menu = menus['file'] = tk.Menu(bar) file_menu.add_command(label=_('New Backup'), command=ui_new_backup) file_menu.add_command(label=_('Open Backup'), command=ui_load_backup) file_menu.add_command(label=_('Save Backup'), command=ui_save_backup) file_menu.add_command(label=_('Save Backup As'), command=ui_save_backup_as) bar.add_cascade(menu=file_menu, label=_('File')) game_menu = menus['game'] = tk.Menu(bar) game_menu.add_command(label=_('Add Game'), command=gameMan.add_game) game_menu.add_command(label=_('Remove Game'), command=gameMan.remove_game) game_menu.add_separator() bar.add_cascade(menu=game_menu, label=_('Game')) gameMan.game_menu = game_menu import helpMenu # Add the 'Help' menu here too. helpMenu.make_help_menu(bar) window['menu'] = bar window.deiconify() window.update() gameMan.load() ui_new_backup() # UI.py isn't present, so we use this callback gameMan.setgame_callback = load_game gameMan.add_menu_opts(game_menu)
def init_application(): """Initialise the standalone application.""" global window window = TK_ROOT TK_ROOT.title( _('BEEMOD {} - Backup / Restore Puzzles').format(utils.BEE_VERSION) ) init() UI['bar'] = bar = tk.Menu(TK_ROOT) window.option_add('*tearOff', False) gameMan.load() ui_new_backup() # UI.py isn't present, so we use this callback gameMan.setgame_callback = load_game if utils.MAC: # Name is used to make this the special 'BEE2' menu item file_menu = menus['file'] = tk.Menu(bar, name='apple') else: file_menu = menus['file'] = tk.Menu(bar) file_menu.add_command(label=_('New Backup'), command=ui_new_backup) file_menu.add_command(label=_('Open Backup'), command=ui_load_backup) file_menu.add_command(label=_('Save Backup'), command=ui_save_backup) file_menu.add_command(label=_('Save Backup As'), command=ui_save_backup_as) bar.add_cascade(menu=file_menu, label=_('File')) game_menu = menus['game'] = tk.Menu(bar) game_menu.add_command(label=_('Add Game'), command=gameMan.add_game) game_menu.add_command(label=_('Remove Game'), command=gameMan.remove_game) game_menu.add_separator() bar.add_cascade(menu=game_menu, label=_('Game')) import helpMenu # Add the 'Help' menu here too. helpMenu.make_help_menu(bar) window['menu'] = bar gameMan.add_menu_opts(game_menu) gameMan.game_menu = game_menu