IDL/DAVE Lunchtime Seminar
Combining Objects and Compound Widgets
Rob Dimeo
July 20, 2004
Limitations of Conventional Compound Widgets ...................................... 2
Requirements and common practices for conventional compound widgets ...... 3
The interface for a compound widget object ......................................... 4
RMD_DICE: A compound object widget replacement for CW_DICE ................ 4
Using RMD_DICE in a sample program................................................... 7
Chuck-a-Luck Simulator ................................................................... 9
Source Code Listing .......................................................................12
1
IDL/DAVE Lunchtime Seminar
The following excerpt is from the on-line help for IDL:
A compound widget is a complete, self-contained, reusable widget sub-tree
that behaves to a large degree just like a widget primitive, but which is
written in the IDL language. Compound widgets allow the development of
reusable widget code, much like a GUI subroutine.
Widget Values of Compound Widgets
Many compound widgets have associated values. Initial values can often be
specified using the VALUE keyword to the creation routine. Note, however,
that in some cases widget values of compound widgets cannot be set until
after the widget is realized; values are thus set, obtained, or changed using
the GET_VALUE and SET_VALUE keywords to the WIDGET_CONTROL procedure.
See the documentation for the individual compound widget creation routines
in the IDL Reference Guide for more detailed information.
Limitations of Conventional Compound Widgets
Often compound widgets (cw) are written in a manner similar to those in the
IDL distribution such as CW_BGROUP, CW_FIELD, etc. We will refer to this
style as conventional. Conventional compound widgets do not use objects in
their implementation. As stated above, users can extract and modify the
widget values from co