Tkinter window Control

Source: Internet
Author: User

>>> from tkinter import *
>>> ROOT=TK ()   Create a new
>>> window=toplevel (Root) # Create a new frame, window is the child window of root  
>>> window.title ("New Window")   #窗口的标题 changed to new Window
'
> >> window.lower () #最小化这个window
>>> window.lower ()
>>> window.lift (Root) #重新显示window  to Raise this window to the top of the "stacking" order in the window manager, call this method with no arguments. can also raise it to a position in the stacking order just above Another toplevel window By passing, window as an argument
>>> window.state ()   #获取window现在的状态
' normal '
>>> window.state ()
' normal '
>>> window.state (' zoomed ')   #最大化窗口
'
>>> Window.state (' withdraw ')   #退出窗口 close
'
>>>
>>> window.state (' iconic ')   #类似最小化. Charting??


‘‘
>>> window.state (' normal ') #重新设置成normal模式
‘‘
>>> Window.state ()
' Normal '
>>> window.iconify ()
‘‘
>>> window.deiconify () #回到正常
‘‘
>>> the distance between window.geometry (' 640x480+50+100 ') and the first root 60 480 is the window size. 50 and 100 are distances
‘‘
>>>
>>> window.resizable (False,false) #设置成不让改变大小
‘‘
>>> window.maxsize (640,480) #设置最大范围
>>> window.minsize (200,200) #设置最小范围
>>> window.resizable (true,true)
‘‘
>>> Root.destroy () #销毁所有窗口

Tkinter window Control

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.