GUIKIT 程序包 教程

Loading GUIs

When you load an interface with GUIRun or GUIRunModal, the widget definitions are turned into runtime widgets and the graphical user interface is immediately displayed on the screen. It may be useful to break up the two-step process of turning a definition into the runtime widgets and displaying of the resulting interface to the screen. Then existing widget properties can be modified before display, or, as a speed improvement to the user, the widgets can be preloaded and then later the interface can be displayed on screen only when requested.

GUILoad provides this functionality by loading and creating a GUIObject instance that defines the runtime classes in the same manner that GUIRun works. However, the interface is not displayed on screen. Only when you later call GUIRun, GUIRunModal, or ReleaseGUIObject on the GUIObject will there be a visual display of the user interface.

Click for copyable input

Here you use GUILoad to create the GUIObject, but there is no immediate display.

Click for copyable input

You are free to change some of the initial values of some of the widgets, such as the default text property of one of the input text fields.

Click for copyable input

You can pass the GUIObject expression to GUIRun or GUIRunModal when you are ready to display the interface to the user. If you decided not to display the GUIObject definition, you would call ReleaseGUIObject to remove any resources and definitions created by GUILoad.

Click for copyable input

Here is a screen shot of what the previous user interface would look like when initially shown.

Click for copyable input