Reference Guide > W Routines > WtClose Function
  

WtClose Function
Closes the current Xt session, and destroys all children of the top-level widget created in WtInit. This routine can also be used to destroy additional widget trees.
Usage
status = WtClose(widget)
Parameters
widget — The widget ID of the top-level shell (long).
Returned Value
status — One (1) indicates success; zero (0) indicates failure.
Keywords
None.
Discussion
This function is usually called in a callback routine to destroy a popup shell (dialog, etc.).
 
note
Rogue Wave has ported a subset of the Widget Toolbox (Wt) functionality that is available for Motif to Microsoft Windows. Because the Widget Toolbox under Windows is not a complete implementation, we recommend that Windows developers use the PV‑WAVE Widgets (Ww) layer or the VDA Tools when developing GUI applications.
Example
This example creates a Motif button labeled Done. When you select the button, the widget is destroyed. To run the example, enter the callback and the example procedures in a file and run them with .RUN.
Callback Procedure Example: Motif
This is the callback routine. Note that the callback routine for the pushbutton widget class requires six parameters. The required callback parameters for Motif widget classes are discussed in Appendix B: Motif Callback Parameters in the PV‑WAVE Application Developer’s Guide.
PRO CancelHelp, wid, data, npar, reason, event, count
   COMMON block, top
   status=WtClose(top)
END
Example Procedure
PRO example
   common block, top
   @wtxmclasses.pro
   top=WtInit('wt_ex2', 'Examples')
   widget=WtCreate('Done', xmPushButtonWidgetClass, top)
   status=WtAddCallback(widget, 'activateCallback', $
      'CancelHelp')
   status=WtSet(top, /Realize)
   WtLoop
END
See Also
For more information about how to write an application program based on the PV‑WAVE Widget Toolbox, refer to Using the Widget Toolbox in the PV‑WAVE Application Developer’s Guide.

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.