|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
按照小甲鱼老师的视频调整了width和high,但是再次打开窗口,还是没有任何的变化- def __choicebox(msg
- , title
- , choices
- ):
- """
- internal routine to support choicebox() and multchoicebox()
- """
- global boxRoot, __choiceboxResults, choiceboxWidget, defaultText
- global choiceboxWidget, choiceboxChoices
- #-------------------------------------------------------------------
- # If choices is a tuple, we make it a list so we can sort it.
- # If choices is already a list, we make a new list, so that when
- # we sort the choices, we don't affect the list object that we
- # were given.
- #-------------------------------------------------------------------
- choices = list(choices[:])
- if len(choices) == 0:
- choices = ["Program logic error - no choices were specified."]
- defaultButtons = ["OK", "Cancel"]
- # make sure all choices are strings
- for index in range(len(choices)):
- choices[index] = str(choices[index])
- lines_to_show = min(len(choices), 20)
- lines_to_show = 20
- if title == None: title = ""
- # Initialize __choiceboxResults
- # This is the value that will be returned if the user clicks the close icon
- __choiceboxResults = None
- boxRoot = Tk()
- boxRoot.protocol('WM_DELETE_WINDOW', denyWindowManagerClose )
- screen_width = boxRoot.winfo_screenwidth()
- screen_height = boxRoot.winfo_screenheight()
- root_width = int((screen_width * 0.4))
- root_height = int((screen_height * 0.25))
- root_xpos = int((screen_width * 0.1))
- root_ypos = int((screen_height * 0.05))
- boxRoot.title(title)
- boxRoot.iconname('Dialog')
- rootWindowPosition = "+0+0"
- boxRoot.geometry(rootWindowPosition)
- boxRoot.expand=NO
- boxRoot.minsize(root_width, root_height)
- rootWindowPosition = "+" + str(root_xpos) + "+" + str(root_ypos)
- boxRoot.geometry(rootWindowPosition)
复制代码
很神奇的是,如果把窗口的长和宽扩大是可以的,但是想缩小就不行了,好像有一个东西把窗口的界面的最小固定住了一样
请问如何解决?
不用太在意Easygui,你后面还会用更多强大的GUI模块(tkinter,PyQt5),
这个只是认识一下。
|
|