当前位置: 首页>>代码示例>>Python>>正文


Python UI.quit_application方法代码示例

本文整理汇总了Python中UI.quit_application方法的典型用法代码示例。如果您正苦于以下问题:Python UI.quit_application方法的具体用法?Python UI.quit_application怎么用?Python UI.quit_application使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UI的用法示例。


在下文中一共展示了UI.quit_application方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: remove_game

# 需要导入模块: import UI [as 别名]
# 或者: from UI import quit_application [as 别名]
def remove_game(_=None):
    """Remove the currently-chosen game from the game list."""
    global selected_game
    lastgame_mess = (
        "\n (BEE2 will quit, this is the last game set!)"
        if len(all_games) == 1 else
        ""
    )
    confirm = messagebox.askyesno(
        title="BEE2",
        message='Are you sure you want to delete "'
                + selected_game.name
                + '"?'
                + lastgame_mess,
        )
    if confirm:
        selected_game.edit_gameinfo(add_line=False)

        all_games.remove(selected_game)
        config.remove_section(selected_game.name)
        config.save()

        if not all_games:
            UI.quit_application()  # If we have no games, nothing can be done

        selected_game = all_games[0]
        selectedGame_radio.set(0)
        add_menu_opts(game_menu)
开发者ID:xDadiKx,项目名称:BEE2.4,代码行数:30,代码来源:gameMan.py

示例2: load

# 需要导入模块: import UI [as 别名]
# 或者: from UI import quit_application [as 别名]
def load():
    global selected_game
    all_games.clear()
    for gm in config:
        if gm != 'DEFAULT':
            try:
                new_game = Game(
                    gm,
                    int(config[gm]['SteamID']),
                    config[gm]['Dir'],
                )
            except ValueError:
                pass
            else:
                all_games.append(new_game)
                new_game.edit_gameinfo(True)
    if len(all_games) == 0:
        # Hide the loading screen, since it appears on top
        loadScreen.main_loader.withdraw()

        # Ask the user for Portal 2's location...
        if not add_game(refresh_menu=False):
            # they cancelled, quit
            UI.quit_application()
        loadScreen.main_loader.deiconify()  # Show it again
    selected_game = all_games[0]
开发者ID:xDadiKx,项目名称:BEE2.4,代码行数:28,代码来源:gameMan.py


注:本文中的UI.quit_application方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。