Python Tkinter ttk组件介绍

说明

ttk的很多组件同Tkinter都是相同的,在这种情况下,ttk将覆盖Tkinter的组件,将采用ttk的特性。—原文如下

And then severalttk widgets (Button, Checkbutton, Entry, Frame, Label, LabelFrame, Menubutton,PanedWindow, Radiobutton, Scale and Scrollbar) will automatically substitutefor the Tk widgets.

使用ttk以后的组件,同windows操作系统(这里是win7系统)的外观的一致性更高,看起来也会舒服很多。

需要注意的是:

ttk的用法同Tkinter还是相同的,但是有一些属性ttk不再支持,如 Tkinter 中的fg,bg 在ttk中以不被支持,它是通过style这个对象进行支持的,其它的方面还是变化不大。

参考:
https://zhuanlan.zhihu.com/p/338491920


原文出处:https://malaoshi.top/show_1IX65fDSoifm.html