-
Book Overview & Buying
-
Table Of Contents
Tcl/Tk 8.5 Programming Cookbook
The tk_chooseColor command displays a dialog window that allows the user to select a color. The actual appearance of the color picker will vary, based on the display manager in use. The return hexadecimal value of the color selected is returned. If the user clicks on the Cancel button, an empty string is returned.
The syntax is as follows:
tk_chooseColor option value …
The tk_chooseColor command accepts one or more option value pairs as detailed in the following table. If no option value pairs are provided, the command will display a dialog with the default values.
|
Option |
Interpretation |
|---|---|
|
|
Sets the starting color to display in the color picker. |
|
|
Specifies the parent of the dialog. The dialog is displayed on top of the parent. |
|
|
Sets the text to be displayed in the dialog title bar. |
In the following example, we will create a frame and then display a color picker dialog and assign the return...
Change the font size
Change margin width
Change background colour