3.8 The create method

Most widgets in the ABAQUS GUI Toolkit employ a two-stage creation process. In the first stage the widget constructor builds the data structures for the widget. In the second stage the toolkit calls the widget’s create method. The create method constructs all the windows required by the widget so that the widget can be displayed on the screen.

In most cases the application startup script first calls the constructors of all the widgets required to build the initial structure of an application by constructing the main window. The script then calls the application object’s create method. This call traverses the entire widget hierarchy calling the create method of each widget. For more information and an example script, see Startup script, Section 11.2.

If you create widgets after the startup script has called the application’s create method, the create method must be called on those new widgets; otherwise, they will not be visible on the screen.

If your dialog box is posted by a form or by a procedure, the infrastructure calls the create() method on the dialog box. However, if you post a dialog box yourself, you must call the create() method on the dialog box before you call its show() method.

Similarly, if you construct icons that are used after a widget has been created, you must call the create() method on those icons before using them in a widget. For example, if you want to change a label's icon after it has already been shown in a dialog box, you must do the following:

  1. Construct the new icon.

  2. Call the new icon's create() method.

  3. Pass the icon to the label using the label's setIcon() method.