本文整理汇总了Python中dialog.Dialog.autowidgetsize方法的典型用法代码示例。如果您正苦于以下问题:Python Dialog.autowidgetsize方法的具体用法?Python Dialog.autowidgetsize怎么用?Python Dialog.autowidgetsize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dialog.Dialog
的用法示例。
在下文中一共展示了Dialog.autowidgetsize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Dialog
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import autowidgetsize [as 别名]
#! python3 # this probably doesn't work. I could make it work for UNIX-like stuff, but nooooo we gotta use Windows
from header import *
from dialog import Dialog
from random import randrange
# import multiprocessing as mp
version = 0.0
d = Dialog(dialog="dialog") # change this to point to your dialog install if it is not in $PATH
d.set_background_title("PhysTools version "+str(version)+" :D")
d.autowidgetsize = True
# cpu_count = mp.cpu_count() # for future multithreading, possible Julia delegation
# are you ready for the ugliest function you've ever seen? get hype
# if you're just starting out go look at the header file, it actually has useful stuff and is organized
while True: # this whole thing is probably hacky af, especially with flow control
code, tag = d.menu("Choose an option. Charge units are "+chargeUnit.describe()+" and angle units are "+
angleUnit.describe()+".",
choices=[("Help", "show help information"),
("Print", "print the active objects"),
("Add", "add an object"),
("Remove", "remove an object"),
("Test", "test the field at a point"),
("Configure", "set options and modes"),
("Save", "save the active objects"),
("Load", "load objects from a file"),
("Exit", "exit")],
title="Main Menu")
if code != d.OK or tag == "Exit":