本文整理汇总了Python中cjh.cli.Cli.center_window方法的典型用法代码示例。如果您正苦于以下问题:Python Cli.center_window方法的具体用法?Python Cli.center_window怎么用?Python Cli.center_window使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cjh.cli.Cli
的用法示例。
在下文中一共展示了Cli.center_window方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from cjh.cli import Cli [as 别名]
# 或者: from cjh.cli.Cli import center_window [as 别名]
# if len(sys.argv[1:]) == 0:
# sys.argv.append('-h')
ARGS = _parse_args()
CONFIG = Config()
LANG = CONFIG.get_lang_key()
if ARGS is not None and ARGS.nox is True:
SHELL = Cli()
else:
SHELL = CONFIG.start_user_profile()
if SHELL.interface in ["Tk"]:
SHELL.main_window.title({"EN": "asciimation player", "EO": "ASCII bildfilm-komencigilo"}[LANG])
if SHELL.interface in ["wx", "Tk"]:
SHELL.center_window(height_=50, width_=180)
if SHELL.interface is "Tk":
SHELL.msg.destroy()
PLAY = tk.Button(SHELL.main_window, text={"EN": "Play", "EO": "Ek"}[LANG], command=lambda: launch_module(CMD_LIST))
PLAY.pack(fill=tk.BOTH, expand=1)
elif SHELL.interface is "wx":
PANEL = wx.Panel(SHELL.main_window, -1)
PLAY = wx.Button(PANEL, -1, "Play", pos=(50, 20))
PLAY.SetDefault()
## Set animation parameters ##
##########
# MAIN #
##########
示例2: print
# 需要导入模块: from cjh.cli import Cli [as 别名]
# 或者: from cjh.cli.Cli import center_window [as 别名]
print('\n') # pylint: disable=C0325
sys.exit('Good bye.')
label_pile = [str(thing) for thing in things]
enum = Enumeration(label_pile, 'Inventory')
selection = Cli.make_page(
header='Main Menu', obj=str(enum) + Cli.hrule(
width=.333, string=True),
func=lambda: SHELL.list_menu(MAIN_MENU))
ARGS = _parse_args()
CONFIG = Config()
if ARGS is not None and ARGS.nox is True:
SHELL = Cli()
else:
SHELL = CONFIG.start_user_profile()
if SHELL.interface in ['Tk', 'wx']:
SHELL.center_window()
MENU_OPTIONS = ['Add a <Thing> to your pile.',
'Hide this menu',
'Discard a <Thing>.',
'Exit']
MAIN_MENU = PlainList(MENU_OPTIONS)
if __name__ == '__main__':
main()
示例3: len
# 需要导入模块: from cjh.cli import Cli [as 别名]
# 或者: from cjh.cli.Cli import center_window [as 别名]
if sys.argv[1] in ['-h', '--help']:
Cli.output(__doc__)
#SHELL.main_window.mainloop()
sys.exit(0)
multiplicend = decimal.Decimal(sys.argv[1])
ans = LONG_PI * multiplicend
title_str += '* {} ='.format(multiplicend)
elif len(sys.argv[1:]) == 2 and {'-o', '--over'} & set(sys.argv[1:]):
dividend = decimal.Decimal(sys.argv[2])
ans = LONG_PI / dividend
title_str += '/ {} ='.format(dividend)
else:
ans = LONG_PI
title_str += '= '
#if ans:
print(ans)
if SHELL.interface == 'Tk':
ans_str = str(ans) + '…'
SHELL.output(ans_str)
msg_width = len(ans_str) * 10
width = msg_width + 40
SHELL.msg.config(width=msg_width)
SHELL.center_window(width_=width, height_=50)
SHELL.main_window.title(title_str)
SHELL.main_window.mainloop()