PV-WAVE Foundation > Application Developer Guide > Using Wave Widgets > Displaying Widgets and Processing Events
Displaying Widgets and Processing Events
After all widgets in a widget hierarchy have been created, they are displayed when the top-level or “root” window is displayed. The following command accomplishes this:
status = WwSetValue(top, /Display)
For more on widget hierarchy, see "The Widget Hierarchy".
Next, control must be transferred to the main event loop, which handles events and executes callbacks. To do this, call the WwLoop function:
WwLoop
The application remains in the main loop until the top-level window is closed with the following call:
status = WwSetValue(top, /Close)
or until the top-level window is closed from the window manager menu. Under Motif, the window manager menu usually contains a Close button.
While the loop is running, any callback procedures that have been defined are executed whenever the appropriate events occur.
Using WwSetValue to display and close widgets is demonstrated in examples throughout this section. See "File Selection Example".