Tk Source Code

View Ticket
Login
Ticket UUID: 35f86988a9ad8de1002ba2653724886a8d9925a2
Title: Changing background color of labelframe causes all widgets to redraw
Type: Bug Version: tcl/tk 8.6 Windows
Submitter: anonymous Created on: 2023-03-20 17:20:37
Subsystem: 08. [(label)frame] and [toplevel] Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2023-03-26 20:07:42
Resolution: None Closed By: nobody
    Closed on:
Description:

When the following code is run, all of the widgets in the window resize and redraw on windows. This causes an unpleasant flashing effect. The problem can be worked around by not setting a size on the labelframe. The problem also does not occur if the labelframe is empty.

#/usr/bin/wish


proc update_color {} {
	for {set i 0} {$i<14} {incr i} {
	.mylabelframe$i configure -background green
	}
	after 1000 update_color
}

for {set i 0} { $i<14} {incr i} {
labelframe .mylabelframe$i -text $i  -width 50 -height 50
label .mylabelframe$i.mylabel$i -text $i
grid .mylabelframe$i.mylabel$i
grid .mylabelframe$i
}

after 1000 update_color
User Comments: fvogel added on 2023-03-26 20:07:42:
A solution could certainly be developed based on the use of a non-NULL maskPtr in the call to Tk_SetOptions() in ConfigureFrame().