DialogsA dialog is a separate window which can be popped up and down as needed.
A dialog provides a container to which other GUI objects can be added.
Gsharp includes a number of dialog types which provide the basis for different
dialog operations. Dialogs must be explicitly popped up and down by the
application, and the convenience functions GuiPopupDialog and GuiPopdownDialog
are provided for this purpose. Example: libgui.gsl function GuiInfo
You can see this dialog by type the following command in the Gsharp Command
Area:
A dialog shell can be given a title using the XuNguiTitle resource, as is done is the example above. The message dialog in this example has only one button, an OK button. When pressed, the callback function GuiPopdownCB is called. This function, also found in $UNIDIR/lib/libgui.gsl, pops down the dialog object using the Gsharp builtin GuiPopdownDialog. This function is not used directly as a callback function because it does not have the parameter list required by a callback function. Once a dialog has been created, it can be popped up using the function GuiPopupDialog. A selection dialog type enables the user to select a string from a list of strings. The selection list is assigned to an array of strings with the XuNguiListItems resource. A selection dialog can be used to complete the functionality of the example gui_lesson1.gsa, where the Page Format button on the File menu is not yet implemented. A selection dialog is created in gui_lesson4.gsa using the statement:
When a selection has been, the callback function can retrieve the selected
item using the function GuiGetString. A corresponding function, GuiSetString,
can be used to set a default selection. Carry on to Positioning GUI Objects |