next up previous contents index
Next: Main Program Up: Implementation of the Previous: Implementation of the

Administration of the Windows

 

There are three kinds of windows. They differ in the shell selected, and in the mode of the event handling. Transient shell windows ( transientShellWidgetClass) have only a thin frame and block all other   windows. This means that no more events are processed until this window is closed and the shell widget is destroyed. This is done by generating the window with the call Xt_popup(widget, XtGrabExklusive) with the toplevel widget ui_toplevel as the parent. Some windows, like the file panel, do not block XGUI, because they are called with Xt_popup(widget, XtGrabNone). The third     kind of windows are created as a top level shell ( topLevelShellWidgetClass) like the manager panel.

Most of the windows (AsciiTextWidget, ToggleWidget, ScrollbarWidget) have panel items that can be changed by the user. These values are commonly stored in global variables, to enable other parts of the program to access them, even after the widget is destoyed. Some resources are predefined as so called fallback resources in the file ui_main.h. The bitmaps for the buttons are located in the directory iconsXgui and are linked to the program at compile time.

  A callback routine is called every time a window is destroyed (for example by clicking DONE in popups). This routine takes care of all necessary actions, before vital information is lost, like copying the values of AsciiTextWidgets into global variables. In addition, there are flags which indicate whether or not a popup is existing.

Many panels contain form widgets, where other widgets can be positioned freely. In XGUI the location of these new widgets is always relative to the position of already existing widgets. The info panel, for example, takes the first line as horizontal reference. The change of widget positions has to be made very carefully, since some widgets have the same variablegif and may not be addressable anymore.

  =9999 To ease the handling of the widgets some routines are given in the file ui_xWidgets.c. They allow the creation of Label-, AsciiText-, Button-, MenuButton-, Toggle- and Scrollbar-Widgets in a form widget. Three functions return the value of an ascii text widget as a string ( ui_xStringFromAsciiWidget), float ( ui_xFloatFromAsciiWidget) or integer ( ui_xIntFromAsciiWidget). To set the contents of a widget to a specific value use ui_xSetString, or ui_xSetLabel. To set/read the state of a toggle use ui_xSetToggleState and ui_xGetToggleState.



next up previous contents index
Next: Main Program Up: Implementation of the Previous: Implementation of the



Niels Mache
Wed May 17 11:23:58 MET DST 1995