1chooseColor(3) User Contributed Perl Documentation chooseColor(3)
2
3
4
6 chooseColor - pops up a dialog box for the user to select a color.
7
9 $color = $widget->chooseColor?(-option=>value, ...)?;
10
12 The method chooseColor is implemented as a perl wrapper on the core tk
13 "command" tk_chooseColor, and $widget is passed as the argument to the
14 hidden -parent option. The implementation of internal tk_chooseColor
15 is platform specific, on Win32 it is a native dialog, and on UNIX/X11
16 it is implemented in terms of Tk::ColorEditor.
17
18 The chooseColor method pops up a dialog box for the user to select a
19 color. The following option-value pairs are possible as command line
20 arguments:
21
22 -initialcolor=>color
23 Specifies the color to display in the color dialog when it pops up.
24 color must be in a form acceptable to the Tk_GetColor function.
25
26 -parent=>$widget
27 Makes $widget the logical parent of the color dialog. The color
28 dialog is displayed on top of its parent window.
29
30 -title=>titleString
31 Specifies a string to display as the title of the dialog box. If
32 this option is not specified, then a default title will be
33 displayed.
34
35 If the user selects a color, tk_chooseColor will return the name of the
36 color in a form acceptable to Tk_GetColor. If the user cancels the
37 operation, the command will return undef.
38
40 $widget->configure(-fg => $parent->chooseColor(-initialcolor => 'gray',
41 -title => "Choose color"));
42
44 color selection dialog
45
46
47
48perl v5.12.0 2010-05-13 chooseColor(3)