Tigeroad 发表于 2020-5-11 16:59:13

35讲EasyGUi无法调整choicebox的高度宽度

按照小甲鱼老师的视频调整了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 = str(choices)

    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)


很神奇的是,如果把窗口的长和宽扩大是可以的,但是想缩小就不行了,好像有一个东西把窗口的界面的最小固定住了一样{:10_261:}
请问如何解决?

Tigeroad 发表于 2020-5-11 17:01:07

D:\\图片\\9.png

qiuyouzhi 发表于 2020-5-11 17:01:08

不用太在意Easygui,你后面还会用更多强大的GUI模块(tkinter,PyQt5),
这个只是认识一下。

Tigeroad 发表于 2020-5-11 17:02:44

qiuyouzhi 发表于 2020-5-11 17:01
不用太在意Easygui,你后面还会用更多强大的GUI模块(tkinter,PyQt5),
这个只是认识一下。

好的 调这个确实费了好长时间T_TT_T

qiuyouzhi 发表于 2020-5-11 17:03:26

Tigeroad 发表于 2020-5-11 17:02
好的 调这个确实费了好长时间T_TT_T

{:10_250:}
页: [1]
查看完整版本: 35讲EasyGUi无法调整choicebox的高度宽度