Monday, 13 March 2017

Color selection

#!/bin/sh
# color_m.tcl \
exec tclsh "$0" ${1+"$@"}
set color ""
button .but -text "color chooser" -command {

set color [tk_chooseColor]
if {$color== ""} return
.lab configure -text "the chosen color is $color"
.lab configure -background $color
}
label .lab -text "No color is chosen"
pack .lab
pack .but

No comments:

Post a Comment