COLORBUTTONBITMAP Name
ColorButtonBitmap
Purpose
The purpose of this program is to create a 24-bit bitmap that can be used to
create a colored widget button.
Author
FANNING SOFTWARE CONSULTING
David Fanning, Ph.D.
1645 Sheely Drive
Fort Collins, CO 80526 USA
Phone: 970-221-0438
E-mail: david@idlcoyote.com
Coyote's Guide to IDL Programming: http://www.idlcoyote.com
Category
Widget Programming Calling Sequence
bitmap = ColorButtonBitmap(theText)
button = Widget_Button(tlb, Value=bitmap)
Required Inputs
theText - The text you wish to have on the button.
Outputs
bitmap - A 3xMxN byte array, representing a 24-bit image that is used
as a button value.
Optional Keywords
BGCOLOR - The name of the background color. For example, 'Yellow', 'Tan', etc.
The name must be compatible with names appropriate for cgColor.
FGCOLOR - The name of the foreground color. For example, 'Navy', 'Black', etc.
The name must be compatible with names appropriate for cgColor.
Dependencies
Reqires cgColor from the Coyote Library:
http://www.idlcoyote.com/programs/cgColor.pro
Example
tlb = Widget_Base(/Row, /Exclusive)
button1 = Widget_Button(tlb, Value=ColorButtonBitmap('Button 1')) ; Normal button.
button2 = Widget_Button(tlb, Value=ColorButtonBitmap('Button 2', FGCOLOR='YELLOW', BGCOLOR='NAVY'))
button3 = Widget_Button(tlb, Value=ColorButtonBitmap('Button 3', BGCOLOR='YELLOW', FGCOLOR='NAVY'))
Widget_Control, tlb, /Realize
Modification History
Written by David Fanning, May 25, 2007 based on code named BitmapForButtonText supplied to the IDL
newsgroup by Dick Jackson: http://www.idlcoyote.com/tip_examples/bitmapforbuttontext.pro.
Fixed a problem with foreground and background colors that caused them to work correctly only
when color decomposition is on--as it should be :-). 6 May 2009.