Running an Application
When all the widgets to be displayed are created and managed, and callbacks, handlers, and timers are defined, you must then realize (display) the root widget in the widget hierarchy and initiate the event loop:
; Create the widgets.
top = WtInit('appl','Appl')
.
.
; Display the widget hierarchy.
status = WtSet(top, /Realize)
; Initiate the event loop.
WtLoop
This causes the routine to loop indefinitely, processing the events and dispatching callbacks, handlers, and timers. The WtLoop procedure can be stopped by destroying and closing the shell widget by calling WtClose:
status=WtClose(top)
See the Example Widget Toolbox Application at the end of this chapter.