Version 3 of chooseColor

Updated 2001-10-08 16:36:47

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

aka tk_chooseColor


A minimal example:

 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