Tkinter 8.5 参考手册: a GUI for Python (五)11 窗口的名称
2016-01-02 19:28
711 查看
http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/window-names.html
rectangular area on the desktop.
A top-level or
root window is a window that
has an independent existence under the window
manager. It is decorated with the window manager's
decorations, and can be moved and resized
independently. Your application can use any number
of top-level windows.
The term “window” also applies to any
widget that is part of a top-level window.
Tkinter names all these windows using a hierarchical
window path name.
The root window's name is
Child windows have names of the form
in string form. For example, a window named
(
Child windows within child windows have names of the
form
the parent window and
integer. For example, a window named
the root window.
The relative name of a window
is the part past the last
path name. To continue the previous example, the
grandchild window has a relative name
To get the path name for a widget
See also Section 26, “Universal widget methods” for methods you can
use to operate on window names, especially the
5.11. Window names
The term window describes arectangular area on the desktop.
A top-level or
root window is a window that
has an independent existence under the window
manager. It is decorated with the window manager's
decorations, and can be moved and resized
independently. Your application can use any number
of top-level windows.
The term “window” also applies to any
widget that is part of a top-level window.
Tkinter names all these windows using a hierarchical
window path name.
The root window's name is
'.'.
Child windows have names of the form
'., wheren'
n[/code] is some integer
in string form. For example, a window named
'.135932060'is a child of the root window
(
'.').
Child windows within child windows have names of the
form
''[/code] wherep.[code]n
p[/code] is the name of
the parent window and
n[/code] is some
integer. For example, a window named
'.135932060.137304468'has parent window
'.135932060', so it is a grandchild of
the root window.
The relative name of a window
is the part past the last
'.'in the
path name. To continue the previous example, the
grandchild window has a relative name
'137304468'.
To get the path name for a widget
w[/code], use
str(.w)
See also Section 26, “Universal widget methods” for methods you can
use to operate on window names, especially the
.winfo_name,
.winfo_parent, and
.winfo_pathnamemethods.
相关文章推荐
- Tkinter 8.5 参考手册: a GUI for Python (五)9图像
- Tkinter 8.5 参考手册: a GUI for Python (五)8(鼠标)指针
- Tkinter 8.5 参考手册: a GUI for Python (五)6
- Tkinter 8.5 参考手册: a GUI for Python (五)5
- Tkinter 8.5 参考手册: a GUI for Python (五)4
- Tkinter 8.5 参考手册: a GUI for Python (五)3
- Tkinter 8.5 参考手册: a GUI for Python (五)2
- Tkinter 8.5 参考手册: a GUI for Python (五)1
- Tkinter 8.5 参考手册: a GUI for Python (五)
- Python帮助函数调试函数 用于获取对象的属性及属性值
- 用PYTHON大量下載www.kma.go.kr的天氣圖
- 《笨办法学Python》 第1课手记
- 《Python入门》第一个Python Web程序——简单的Web服务器
- Python学习笔记7-把函数当参数传递、指定可变参数
- Python学习笔记7-把函数当参数传递、指定可变参数
- 《笨办法学Python》 第0课手记
- MLlib里几个简单的分类模型(python)
- python读入文件
- python学习笔记一(基础篇)
- SocketServer module