>>> from Tkinter import * >>> from ttk import *
so that those widgets replaced by ttk will be imported over the older ones in Tkinter.
These include:
Widget | Tkinter | ttk |
---|---|---|
Button | X | X |
Canvas | X | |
Checkbutton | X | X |
Combobox | X | |
Entry | X | X |
Frame | X | X |
Label | X | X |
LabelFrame | X | X |
Listbox | X | |
Menu | X | |
Menubutton | X | X |
Message | X | |
Notebook | X | |
OptionMenu | X | |
PanedWindow | X | X |
Progressbar | X | |
Radiobutton | X | X |
Scale | X | X |
Scrollbar | X | X |
Separator | X | |
Sizegrip | X | |
Spinbox | X | Tk8.5.9 |
Text | X | |
Treeview | X | |
Toplevel | X |
I'm not going to include Tix because there are over 40 widgets that are added, but there are two important differences between Tix and ttk.
- Tix hasn't seen development since 2008 whereas ttk was last upgraded in 2012
- Tix isn't part of Tk/Tcl - it is a 3rd party add-on.
Tix Meter Widget |
ttk Progressbar widget |
So I think I'm going to stick with ttk imported on top of Tkinter as suggested by Python, and I'll only supplement these widgets with Tix if I absolutely must, since the ttk widgets really do seem better.
No comments:
Post a Comment