小甲鱼 发表于 2015-5-17 12:35:39

已有 12 人购买  本主题需向作者支付 10 鱼币 才能浏览 购买主题

yejinhe1986 发表于 2016-11-24 09:02:16

谢谢楼在分享

guanjinwei 发表于 2017-2-11 23:00:56

谢谢,我刚刚开始学习

python911 发表于 2017-8-8 14:35:23

后面的怎么都没人评论了,可能很多人没坚持下来吧

学学看看 发表于 2018-10-19 16:38:06

墨羽箭 发表于 2018-12-26 16:54:55

方法

deiconify()
Displays the window, after using either the iconify or the withdraw methods.
在使用iconify或者withdraw方法后,显示窗口。

frame()
Returns a system-specific window identifier.
返回一个系统特定的窗口标识符

group(window)
Adds the window to the window group administered by the given window.
给特定的窗口分组

iconify()
Turns the window into an icon, without destroying it.
把窗口变成了一个图标,且不破坏它

protocol(name, function)
Registers a function as a callback which will be called for the given protocol.
给特定的协议添加一个回调函数

state()
Returns the current state of the window. Possible values are normal, iconic, withdrawn, and icon.
返回窗口的当前状态。可能的值是正常的,标志性、撤销和图标。

transient()
Turns the window into a temporary(transient) window for the given master, or to the window's parent, when no argument is given.
把窗口作为临时窗口给master,如果没有给参数,就给父窗口

withdraw()
Removes the window from the screen, without destroying it.
从屏幕上删除窗口,且不破坏它。

maxsize(width, height)
Defines the maximum size for this window.
定义这个窗口的最大尺寸。

minsize(width, height)
Defines the minimum size for this window.
定义这个窗口的最小尺寸。

positionfrom(who)
Defines the position controller.
定义位置控制器。

resizable(width, height)
Defines the resize flags, which control whether the window can be resized.
定义大小标志,它控制是否可以调整大小的窗口。

sizefrom(who)
Defines the size controller.
定义尺寸的控制器。

title(string)
Defines the window title.
定义窗口名字。

nichengang 发表于 2019-8-14 22:22:23


谢谢楼在分享

雨冷青杉 发表于 2019-10-15 16:43:11

确实是好东西啊

aferzhong 发表于 2020-4-24 15:04:22

楼主你好, 可否能在Toplevel这个窗口中, 添加文本框, 从而输入并获取呢, 这块有点费解

我是桃川人 发表于 2021-1-15 10:44:13

如何只能创建一个 toplevel 窗口?

我是桃川人 发表于 2021-1-15 12:47:18

我是桃川人 发表于 2021-1-15 10:44
如何只能创建一个 toplevel 窗口?

root = Tk()
top = Toplevel(master=root)
top.grab_set()# master=root 后加上这个方法让根界面无法进行操作
页: [1]
查看完整版本: Tkinter 窗口组件:Toplevel