Graphical Interfaces with IDL Widgets

IDL allows you to construct and manipulate graphical user interfaces using widgets. Widgets are simple graphical objects such as pushbuttons or sliders that allow user interaction via a pointing device (usually a mouse) and a keyboard. Widget applications can be simple or complex; the IDL iTools are examples of sophisticated applications with a graphical user interface constructed from IDL widgets.

While creating an interface using IDL widgets is significantly simpler than building a similar interface using native window system graphical interface toolkits, the style of programming required is fundamentally different than in other IDL programs. A program written to be used from the IDL command line generally accepts its inputs when the program is invoked. The program then proceeds in a well-defined order to process those inputs and provide some output — a calculated value, a plot, an image, etc. In contrast, widget applications are event-driven.

In an event-driven system, the program creates an interface and then waits for messages (events) to be sent to it from the window system. Events are generated in response to user manipulation, such as pressing a button or moving a slider. The program responds to events by carrying out the action or computation specified by the programmer, and then waiting for the next event.

See A Simple Widget Example for code that creates a very simple widget application that allows you to choose and display a JPEG image file from the IDL distribution.

simple_widget_app.gif