Tk Library Source Code

View Ticket
Login
Ticket UUID: 2034464
Title: columnconfigure -bg isn't respected for -state disabled
Type: Bug Version: None
Submitter: pointsman Created on: 2008-07-31 23:14:28
Subsystem: tklib :: tablelist Assigned To: nemethi
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2008-08-23 03:21:07
Resolution: Fixed Closed By: nemethi
    Closed on: 2008-08-22 20:21:07
Description:
A tablelist with -state disable doesn't respect columnconfigure -background settings unter a lot of circumstances. If the -state is disabled, the -background color of the widget itself is used as background color. Though, even that isn't always the case. Sometimes, even with -state disabled, the column -background setting is respected. 

The script below illustrates this. The tablelist widgets .tl1 and .tl2 differ only in the -state -- .tl2 is disabled.

With a click on the button you change the 3. tablelist. Its content change and it is switched to -state disabled, but the colum -background settings are respected.

If you hit a second time at the button, the column -background settings are forgotten.

package require tablelist

proc changetl3 {} {
    global tl3
    set tl3 [list]
    lappend tl3 [list "" ""]
    .tl3 configure -state disabled
}

set cols {
    0 "Column 1" left
    0 "Column 2" left
}

lappend tl1 [list foo bar]
lappend tl2 [list foo bar]
lappend tl3 [list foo bar]
for {set i 1} {$i < 4} {incr i} {
    tablelist::tablelist .tl$i \
        -height 4 \
        -columns $cols \
        -background green \
        -listvariable tl$i
}

foreach tl {.tl1 .tl2 .tl3} {
    $tl columnconfigure 0 -background white
    $tl columnconfigure 1 -background red
}
.tl1 configure -state disabled

button .b -text "Disable tl3" -command changetl3

pack .tl1 .tl2 .tl3 .b
User Comments: nemethi added on 2008-08-02 04:40:48:
Logged In: YES 
user_id=317958
Originator: NO

Since there is no -disabledbackground option for tablelist widgets, a disabled tablelist uses the normal background color at widget, column, row, and cell levels.  This is implemented with the aid of a text widget tag.  Under some circumstances, parts of the body text widget might lose this tag, thus giving rise to the erroneous behavior reported by Ralf.

I have checked in a corrected version of the distribution file tablelistUtil.tcl.  This should fix the bug.

pointsman added on 2008-08-01 06:16:57:
Logged In: YES 
user_id=13222
Originator: YES

That is with tablelist 4.6 and 4.9.2, under linux.