Version 2 of chooseColor

Updated 2001-10-08 01:56:06

http://purl.org/tcl/home/man/tcl8.4/TkCmd/chooseColor.htm

aka tk_chooseColor

[Someone want to add an example of how to use this?]


Okay, this is about as simple as is gets:


 button .b_fg -text "Set Foreground Color" -command {fg_color}
 button .b_bg -text "Set Background Color" -command {bg_color}
 label .l -text "Foreground Color on Background Color"

 grid .b_fg .b_bg -sticky ew
 grid .l -row 1 -columnspan 2 -sticky ew

 proc fg_color { } {
        set color [tk_chooseColor]
        .l configure -fg $color
        }

 proc bg_color { } {
        set color [tk_chooseColor]
        .l configure -bg $color
        }

 wm title . "tk_chooseColor Example"

Tk syntax help - Arts and crafts of Tcl-Tk programming - Category Command