Version 5 of tk_chooseColor

Updated 2003-08-06 14:23:31

This function is documented as "chooseColor".


Michael Schlenker contributed the following example of the use of this function over on comp.lang.tcl:

 # set color variable to color value returned from tk_chooseColor
 set color [tk_chooseColor]
 # be .c an canvas with some objects in it , sets the -fill color of all
 # items to $color
 .c itemconfigure all -fill $color

Robert Heller also answered in the same comp.lang.tcl thread with this code fragment:

 canvas .thecanvas
 pack .thecanvas
 .thecanvas create oval 0 0 50 50 -fill red -outline blue -tag theOval
 .thecanvas itemconfigure theOval -fill \
        [tk_chooseColor -initialcolor [.thecanvas itemcget theOval -fill]]
 .thecanvas itemconfigure theOval -outline \
        [tk_chooseColor -initialcolor [.thecanvas itemcget theOval -outline]]








Category Dialog - Category Command - Tk syntax help - Arts and Crafts of Tcl-Tk Programming Category GUI