鱼C论坛

 找回密码
 立即注册
查看: 834|回复: 4

[已解决]35讲EasyGUi无法调整choicebox的高度宽度

[复制链接]
发表于 2020-5-11 16:59:13 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
按照小甲鱼老师的视频调整了width和high,但是再次打开窗口,还是没有任何的变化
  1. def __choicebox(msg
  2.     , title
  3.     , choices
  4.     ):
  5.     """
  6.     internal routine to support choicebox() and multchoicebox()
  7.     """
  8.     global boxRoot, __choiceboxResults, choiceboxWidget, defaultText
  9.     global choiceboxWidget, choiceboxChoices
  10.     #-------------------------------------------------------------------
  11.     # If choices is a tuple, we make it a list so we can sort it.
  12.     # If choices is already a list, we make a new list, so that when
  13.     # we sort the choices, we don't affect the list object that we
  14.     # were given.
  15.     #-------------------------------------------------------------------
  16.     choices = list(choices[:])
  17.     if len(choices) == 0:
  18.         choices = ["Program logic error - no choices were specified."]
  19.     defaultButtons = ["OK", "Cancel"]

  20.     # make sure all choices are strings
  21.     for index in range(len(choices)):
  22.         choices[index] = str(choices[index])

  23.     lines_to_show = min(len(choices), 20)
  24.     lines_to_show = 20

  25.     if title == None: title = ""

  26.     # Initialize __choiceboxResults
  27.     # This is the value that will be returned if the user clicks the close icon
  28.     __choiceboxResults = None

  29.     boxRoot = Tk()
  30.     boxRoot.protocol('WM_DELETE_WINDOW', denyWindowManagerClose )
  31.     screen_width  = boxRoot.winfo_screenwidth()
  32.     screen_height = boxRoot.winfo_screenheight()
  33.     root_width    = int((screen_width * 0.4))
  34.     root_height   = int((screen_height * 0.25))
  35.     root_xpos     = int((screen_width * 0.1))
  36.     root_ypos     = int((screen_height * 0.05))

  37.     boxRoot.title(title)
  38.     boxRoot.iconname('Dialog')
  39.     rootWindowPosition = "+0+0"
  40.     boxRoot.geometry(rootWindowPosition)
  41.     boxRoot.expand=NO
  42.     boxRoot.minsize(root_width, root_height)
  43.     rootWindowPosition = "+" + str(root_xpos) + "+" + str(root_ypos)
  44.     boxRoot.geometry(rootWindowPosition)
复制代码


很神奇的是,如果把窗口的长和宽扩大是可以的,但是想缩小就不行了,好像有一个东西把窗口的界面的最小固定住了一样
请问如何解决?
最佳答案
2020-5-11 17:01:08
不用太在意Easygui,你后面还会用更多强大的GUI模块(tkinter,PyQt5),
这个只是认识一下。
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2020-5-11 17:01:07 | 显示全部楼层
D:\\图片\\9.png
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-5-11 17:01:08 | 显示全部楼层    本楼为最佳答案   
不用太在意Easygui,你后面还会用更多强大的GUI模块(tkinter,PyQt5),
这个只是认识一下。
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

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

好的 调这个确实费了好长时间T_TT_T
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-5-11 17:03:26 | 显示全部楼层
Tigeroad 发表于 2020-5-11 17:02
好的 调这个确实费了好长时间T_TT_T

小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-19 02:45

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表