
322 Chapter 14: Creating a User Interface Panel
Example: A Simple UI Panel iTool Developer’s Guide
Example: A Simple UI Panel
The following example creates a simple user interface panel consisting of two
buttons: Rotate and Hide/Show. The Rotate button rotates the selected iTool
component 90 degrees, if possible. The Hide/Show button toggles the value of the
HIDE property of the selected object.
Note
This example is intended to demonstrate the concepts involved in creating a user
interface panel. For examples of more useful panels, see the files
idlitwdimgmenu.pro and idlitwdvolmenu.pro, which create the user
interface panels for the IIMAGE and IVOLUME iTools, respectively. Both files are
located in the
lib/itools/ui_widgets subdirectory of the IDL installation
directory.
To display a user interface panel named Example4_panel, this example creates the
following items:
• Panel Creation Routine
• Panel Event Handler Routine
• Panel Callback Routine
• Panel Type Specification
Example Code
The code for this example user interface panel is included in the file
example4_panel.pro in the examples/doc/itools subdirectory of the IDL
Figure 14-1: The example panel.