[Tkinter-discuss] Strange 'tate' option in ttk.Treeview.heading

Kevin Walzer kw at codebykevin.com
Thu Apr 11 16:19:05 CEST 2013


Hi Jeff,

I don't think you're correct on this point.

On 4/11/13 8:32 AM, Jeff Epler wrote:
> This is an upstream bug in Tk which appears to still be present in their
> development version.  There's supposed to be a "-state" property of
> treeview columns, but the "-" is missing.  Python always removes the
> first character in its configure-type interfaces, so you get "tate"

The ttk widgets handle some things differently than the standard Tk 
widgets. According to the man page (of Tk 8.5 at 
http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_treeview.htm, with the ttk 
widgets, "state" is a command rather than a configuration option:

pathname state ?stateSpec?
Modify or query the widget state; see ttk::widget(n).

Therefore, rather than Tk being wrong, Python is doing the wrong thing 
by mangling the command.

>
> Compare the definition of "-text" to "state" at lines 296 and 308:
> http://tktoolkit.cvs.sourceforge.net/viewvc/tktoolkit/tk/generic/ttk/ttkTreeview.c?revision=1.41&view=markup#l295

For what it's worth, here is the core repo for Tcl/Tk now: 
http://core.tcl.tk.  The project shifted its SCM from CVS to Fossil 
(http://fossil-scm.org/) about a year ago.

I do understand the confusion. In the ttk widget C code, "state" is 
grouped among the configuration options, and its purpose is to set 
configuration, but it does so as a command, not as a flag passed to the 
"configure" command. I'm not sure why it was implemented this way, but 
that does appear to be its design. Perhaps someone should file a bug 
against Python to make sure it's implemented correctly in Tkinter?

--Kevin

-- 
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com


More information about the Tkinter-discuss mailing list