[Tkinter-discuss] Re: Another problem -- deselecting individual entriesin Tix HList

Fredrik Lundh fredrik at pythonware.com
Wed Mar 2 20:14:22 CET 2005

Jared Cohen wrote:

> According to the documentation for the Tcl version of Tix, it's possible to use selection_clear() 
> to deselect individual entries, as opposed to the entire selection. The documentation says the 
> following:
> pathName selection clear ?from? ?to?
> When no extra arguments are given, deselects all of the list entrie(s) in this HList widget. When 
> only from is given, only the list entry identified by from is deselected. When both from and to 
> are given, deselects all of the list entrie(s) between between from and to, inclusive, without 
> affecting the selection state of entries outside that range.
> However, I can't for the life of me figure out how to get this functionality in Python. You'd 
> think that you could just pass in "from" and "to" as individual arguments, but you'd be wrong --  
> the Python version of selection_clear() has the form:    selection_clear(self, cnf={}, **kw) . It 
> expects a dictionary and/or a keyword list. And I can't figure out the right syntax for that 
> "from-to" thing. Can anyone help please?

might be a bug in the Python binding.  does the following "direct" call
work as expected?

    widget.tk.call(widget, "selection", "clear", fromvalue, tovalue)


More information about the Tkinter-discuss mailing list