How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"?

Ben Finney ben+python at benfinney.id.au
Fri Mar 2 22:34:35 EST 2012


Terry Reedy <tjreedy at udel.edu> writes:

> On 3/2/2012 8:48 PM, John Salerno wrote:
> > from tkinter import *
> > from tkinter.ttk import *
>
> I suppose the 'advantage' of this is that it will replace tk widgets
> with equivalent ttk widgets, if they exist and have the same name. I
> believe one has to program them differently, however, so the
> replacement cannot be transparent and one mush know anyway what gets
> replaced and what not.

Yes, and one mush is exactly what one gets when clobbering the namespace
with ‘from foo import *’ :-)

-- 
 \     “We are human only to the extent that our ideas remain humane.” |
  `\                          —_Breakfast of Champions_, Kurt Vonnegut |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list