Application Developer Guide > Using the Widget Toolbox > Creating Widgets
  

Creating Widgets
Rather than dealing directly with X library windows, applications using Xt Intrinsics-based toolkits (Motif) use widgets.
A widget is a complex data structure containing interface-related data and set of procedures that perform actions on that data.
Each widget is represented externally by a widget ID. Widgets form hierarchies known as widget trees. The root of every widget hierarchy is a special type of widget called a shell. The shell widget provides an interface between the child widget and the window manager.
The WtCreate function provides the general mechanism for creating all PV-WAVE widgets. For example:
result = WtCreate('name', class, parent, args)
 
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 10.0 Widgets (Ww) layer or the VDA Tools when developing GUI applications.
The name parameter is a string that identifies the widget. The class parameter is a widget class ID that specifies the type of widget to be created. Widget class IDs are long values defined in the Standard Library files wtxmclass.pro. The widget class IDs for Motif are also listed in Motif Widget Classes.
The parent parameter must be a widget ID of a widget that already exists. This can be a shell or any other type of widget that can have child widgets. The args parameter specifies values for resources used by the widget. See the next section for information on setting resources.
See the example Widget Toolbox application at the end of this chapter.

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.