The following procedures build a simple tabbed interface with three tabs containing a variety of other widgets.

This example is included in the file tab_widget_example1.pro in the examples/doc/widgets subdirectory of the IDL distribution. Run this example procedure by entering tab_widget_example1 at the IDL command prompt or view the file in an IDL Editor window by entering .EDIT tab_widget_example1.pro. See Running the Example Code if IDL does not run the program as expected.

Calling tab_widget_example1 with the LOCATION keyword set to an integer value between 0 and 4 displays the same interface with the tabs placed on different sides.

As with many of the examples in this section, this one is designed to merely exhibit the features of the tab widget. Most of the useful things you might do with a tab widget take place in the event handling routines for the individual widgets displayed on each tab; see Example: Retrieving Values for a more complicated example that stores the values of the individual widgets for later use.