summaryrefslogtreecommitdiffstats
path: root/library/demos/widget
diff options
context:
space:
mode:
authorcsaba <csaba>2023-09-06 10:07:36 (GMT)
committercsaba <csaba>2023-09-06 10:07:36 (GMT)
commit7a8cd78e748ee242274db090016adac361dcfa23 (patch)
tree60e30b44e01a317127a42b5ec86e1a8fcd5af832 /library/demos/widget
parent53d3983c5c066cdaddd30b4b259aad12f5eb7a37 (diff)
downloadtk-7a8cd78e748ee242274db090016adac361dcfa23.zip
tk-7a8cd78e748ee242274db090016adac361dcfa23.tar.gz
tk-7a8cd78e748ee242274db090016adac361dcfa23.tar.bz2
Improvements related to the Ttk field element and the Widget Demo.
Diffstat (limited to 'library/demos/widget')
-rw-r--r--library/demos/widget15
1 files changed, 7 insertions, 8 deletions
diff --git a/library/demos/widget b/library/demos/widget
index 2d47d37..83fab82 100644
--- a/library/demos/widget
+++ b/library/demos/widget
@@ -86,15 +86,14 @@ set printData {
}
proc createImages {} {
+ set fgColor [ttk::style lookup . -foreground {} black]
+ lassign [winfo rgb . $fgColor] r g b
+ set fgColor [format "#%02x%02x%02x" \
+ [expr {$r >> 8}] [expr {$g >> 8}] [expr {$b >> 8}]]
+
foreach action {view refresh print} {
- set fgColor [ttk::style lookup . -foreground {} black]
- lassign [winfo rgb . $fgColor] r g b
- set fgColor [format "#%02x%02x%02x" \
- [expr {$r >> 8}] [expr {$g >> 8}] [expr {$b >> 8}]]
-
- global ${action}Data
- set data [set ${action}Data]
- for {set startIdx 0} \
+ upvar ${action}Data imgData
+ for {set data $imgData; set startIdx 0} \
{[set idx1 [string first "#000000" $data $startIdx]] >= 0} \
{set startIdx [expr {$idx1 + 7}]} {
set idx2 [expr {$idx1 + 6}]