Loading and Showing Forms
- Last UpdatedOct 29, 2024
- 1 minute read
A form definition must be loaded before the form can be displayed.
If you have saved the definition in a .pmlfrm file then loading will be automatic when the form is displayed for the first time.
Note:
Earlier AppWare used form definitions in macro files which had to be loaded explicitly
via $m path-name. This mechanism still operates for backwards compatibility, but is strongly discouraged
when writing new AppWare.
Normally, a form is displayed as a result of the operator making a menu selection or pressing a button on a form. This is achieved either by using the Form directive in the menu or button definition or by means of the command:
show !!formname
used in the gadget’s callback. In either case the form becomes a child of the menu’s or gadget’s owning form.
A form may be displayed free-standing (not as a child) by:
show !!formname free
Sometimes it is useful to force the loading of the definition file of a form before the form is actually displayed, so that you can edit the form or gadget attributes from the callbacks of another form before the form is actually displayed. Using the command:
loadform !!formname
from a callback will force load the definition if the form is unknown to PML, but do nothing if the form has already been loaded.
If you are sure that a form's definition has been loaded then you can show the form as a child or free-standing respectively using the form methods:
!!formname.show( )
!!formname.show( 'free' )
Note that this will not dynamically load the form definition.