Tkinter1
【1701H1】【穆晨】【180205】第118天总结
Tkinter模块("Tk 接口")是Python的标准Tk
GUI工具包的接口.Tk和Tkinter可以在大多数的Unix平台下使用,同样可以应用在Windows和Macintosh系统里.Tk8.0的后续版本可以实现本地窗口风格,并良好地运行在绝大多数平台中.
TK+interface=Tkinter
label组件:显示文本,图标,图片
pack自动调节组件的尺寸位置
mainloop主事件循环
Frame框架,在大程序里需要多个框架存放内容
pack尺寸位置,tk.RIGHT居右,LEFT居左,padx,水平距离,pady垂直距离
Button按钮,fg文本内容颜色,bg按钮背景颜色,command按钮触发后的代码
1 |
bg The normal background color displayed behind the label and indicator. |
2 |
bd The size of the border around the indicator. Default is 2 pixels. |
3 |
cursor If you set this option to a cursor name (arrow, dot etc.), the mouse cursor will change to that pattern when it is over the checkbutton. |
4 |
height The vertical dimension of the new frame. |
5 |
highlightbackground Color of the focus highlight when the frame does not have focus. |
6 |
highlightcolor Color shown in the focus highlight when the frame has the focus. |
7 |
highlightthickness Thickness of the focus highlight. |
8 |
relief With the default value, relief=FLAT, the checkbutton does not stand out from its background. You may set this option to any of the other styles |
9 |
width The default width of a checkbutton is determined by the size of the displayed image or text. You can set this option to a number of characters and the checkbutton will always have room for that many characters. |