CREATE Method (System)
Description
This method creates one or more GUI objects from a passed structure.
Syntax
SuccessFlag = Exec_Method( "SYSTEM", "CREATE", CreateStruct, ScaleUnits )
Parameters
Name | Required | Description |
---|---|---|
CreateStruc | Yes | This is a @fm-delimited dynamic array containing a list of object structures to create. Each object has its own @vm-delimited structure that specifies its attributes such as Name, Type, Parent, Position and so on. Constants that describe the core structure of an object can be found in the PS_EQUATES insert record. There are further "PS_" records that cover each type in more detail. |
ScaleUnits | No | Specifies if the units defined in the CreateStruct should be interpreted as DIPs (the default) or Pixels. This value is the same as the common GUI SCALEUNITS property. |
Returns
This method returns TRUE$ if all objects were created successfully, or FALSE$ otherwise.
Remarks
The preferred way to check if an object was created successfully is to check that it's HANDLE property is valid after the CREATE method returns.
This is a "raw" low-level method to instruct the Presentation Server to create one or more objects. It will not change the underlying "window common area" to add in any new entries for the newly-created objects, such as synthetic properties (like VALID and CONV), or QuickEvent handlers. These must be updated via other means.
Example
// Example - create a new STATIC control called "TXT_INFO" based on the // structure of an existing one (TXT_TEMPLATE) $Insert PS_Equates // Get the original structure for the STATIC CtrlStruct = Get_Property( @Window : ".TXT_TEMPLATE", "ORIG_STRUCT" ) // Update the name, text and position CtrlStruct<PSPOS_NAME$> = @Window : ".TXT_INFO" CtrlStruct<PSPOS_TEXT$> = "Here are the gory details" CtrlStruct<PSPOS_X$> = 10 CtrlStruct<PSPOS_Y$> = 20 IsCreated = Exec_Method( "SYSTEM", "CREATE", CreateStruct )
See Also
Common GUI SCALEUNITS property, Common GUI HANDLE property, Common GUI ORIG_STRUCT property, DESTROY method.