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

Kevin Walzer kw at codebykevin.com
Sun Mar 4 20:58:23 EST 2012


On 3/3/12 12:06 AM, John Salerno wrote:
>> 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.
>
> Grr, sounds like a pain if I want to use the new widgets. Does this cause conflict with someone who isn't running 8.5, or will they still see the older widgets as normal?
>
> I'm tempted just to go back to wxPython. Two sets of widgets in Tkinter is a little annoying.

The new widgets are not a drop-in replacement for the traditional Tk 
widgets. They can be used with 8.4 if the "tile" Tk extension is 
installed. This is how the ttk widgets were first deployed; they didn't 
enter Tk's core until 8.5.
-- 
Kevin Walzer
Code by Kevin
http://www.codebykevin.com



More information about the Python-list mailing list