本文整理汇总了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)
示例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]