Description: |
I guess the question is, is it important that Tk react in a dynamic
fashion to theme changes? If so, the following is a bug.
But if requiring the user to stop and restart Tk is reasonable, then
this is not a bug and can be closed.
At the moment, I am thinking that having Tk react dynamically
would be nice, but I don't think it is a requirement.
Windows 7:
Using the script below, I get the following output:
% source xyz.tcl
SystemButtonFace
blue
61680 61680 61680 #f0f0f0
# At this point, the script waits.
# I change the windows theme from the default to one of the
# high-contrast themes.
# Then I create the file xyz.txt.
# (I tried: gets stdin line; locked up the windows machine).
SystemButtonFace
SystemButtonFace
61680 61680 61680
% exit
The ttk::frame changes its background color, and now reports
its background as SystemButtonFace.
But fetching the rgb for SystemButtonFace returns the old color.
I can tell I have a new theme, but I have no way of getting the
current colors for it.
package require Tk
ttk::frame .f -style B.TFrame -width 20 -height 20
ttk::style configure B.TFrame -background blue
pack .f
puts [ttk::style lookup TFrame -background]
puts [ttk::style lookup B.TFrame -background]
puts [winfo rgb . SystemButtonFace]
update
while { ! [file exists xyz.txt] } {
set ::x 0
after 1000 [list set ::x 1]
vwait ::x
}
puts [ttk::style lookup TFrame -background]
puts [ttk::style lookup B.TFrame -background]
puts [winfo rgb . SystemButtonFace]
|