|-language This is optional. Default is en. This option allows you to set the language for the title and labels. Valid values are en (english), de (german), fr (french) and english (for backward compatibility) which is also the default. Translations are by Babelfish. Other languages will be added if people provide translations.|
|-title This is optional and allows you to set the title. Default is Colour Chooser in the -language specified.|
|-colour This is optional and allows you to specify the colour that is shown when the dialogue is invoked. It may be specified as a colour name from rgb.txt or as a six digit hex number with an optional leading hash, i.e. as HHHHHH or #HHHHHH. Default is black.|
|-hexonly This is optional. If set to 1 it forces the ColourChooser to only return colours as hex numbers in Tk format (#HHHHHH); if set to 0 it returns colours as names if they are named in rgb.txt, and as hex numbers if they have no name. Transparent is always returned as None however. Default is 0.|
|-transparent This is optional. If set to 0 it stops ColourChooser offering the Transparent button so that only valid colours may be chosen - or cancel. Default is 1.|
|-showhex This is optional. If set to 1 it shows the hex value of the colour in the title bar. Default is 0.|
Pressing OK will return the selected colour, as a name if it has one or as an RGB value if it doesnt. (Colours which do not have names are listed as Unnamed in the colour list box.) If the -hexonly option has been specified the colour is always returned as a Tk colour hex value, i.e. in the form #HHHHHH except if Transparent is chosen in which case None is returned.
OK is pressed by a mouse click or <Return> or <o> or <Control-o> or <Alt-o>.
Pressing Transparent will return the string None which is xpms name for transparent.
Transparent is pressed by a mouse click or <t> or <Control-t> or <Alt-t>.
Pressing Cancel will return an empty string.
Cancel is pressed by a mouse click or <Escape> or <c> or <Control-c> or <Alt-c>. (Note that if the language is not english then the letter to press will be the first letter of the translation of the word Cancel.
ColourChooser.pm should be placed in any Tk directory in any lib directory in Perls %INC path, for example, /usr/lib/perl5/Tk.
ColourChooser looks for the file rgb.txt on your system - if it cant find it you will only be able to specify colours by RGB value. Or you can set the environment variable RGB_TEXT to the filename.
Populate Inherited from Tk::Toplevel Show Inherited from Tk::Toplevel
Does almost no error checking.
Can be slow to load because rgb.txt is large; however we now load a single instance of the colour names when the module is first used and these names are then shared.
If you scroll the list by keyboard or use the mouse to move the colour sliders the colour updates as you go; but if you use the mouse on the scrollbar you must click the colour name box for the colour to update. I dont know why this is and any advice on how to fix it would be welcome.
This module was developed by Mark Summerfield <email@example.com> until version 1.50.
The code draws from Stephen O. Lidies work.
Copyright (c) Mark Summerfield 1999-2000. All Rights Reserved.
This module may be used/distributed/modified under the LGPL.
|perl v5.20.3||TK::COLOURCHOOSER (3)||2008-03-28|