tablelist 4.11: <<TablelistSelect>> even if -state disabled

tablelist 4.11: <<TablelistSelect>> even if -state disabled

Post by Ralf Fasse » Sun, 31 May 2009 00:12:09

tablelist 4.11

It should be documented that the virtual <<TablelistSelect>> event gets
delivered even if that table is configured -state disabled. Scripts
which are not expected to run on disabled tables should inspect the
-state of the table and do nothing if it is 'disabled'.

set foobar {{11 12 13} {21 22 23} {31 32 33}}
pack [tablelist::tablelist .t \
-selectmode browse -selecttype cell -exportselection false \
-listvariable foobar -columntitles {foo bar baz}]\
-expand yes -fill both
.t cellselection set 0,0
.t configure -state disabled
bind .t <<TablelistSelect>> {puts "selected {[%W curcellselection]}"}

This prints
selected {0,0}
if the mouse is dragged or clicked on the disabled table.


tablelist 4.11: <<TablelistSelect>> even if -state disabled

Post by Csaba Neme » Sun, 31 May 2009 06:09:02

Ralf Fassel schrieb:

The Tk listbox widget exhibits the same behavior, and the listbox manual
page doesn't mention it. You are right that this should be documented.

Csaba Nemethi mailto: XXXX@XXXXX.COM