Laserfiche WebLink
this code may be somewhat repetitive and verbose (e.g., the creation of ten buttons may result in the <br />duplication of ten sets of code segments, without consideration of whether more compact code can <br />be written). <br />Macro language versions of the code consist of language such as the following: <br />attach push-button "quit-button" to button-manager "main- <br />buttons" <br />color: blue <br />width:100 <br />height:20 <br />border:2 <br />label:"Quit" <br />callback:quit_program <br />This type of representation for a GUI is used because the GUI builder must have some information to <br />recreate the GUI if it is being edited after the first time. It is much easier for the GUI builder to <br />recreate source code from the above macro language than to try to understand the source code itself <br />(especially if a developer has changed the source code for some reason). An important consideration <br />is that each GUI component part has an identifier and type. For example, in the macro code above, <br />the component has a name ?quit-button? and a type ?push-button.? <br />An additional file that is often associated with a graphics-based program is a resource file, which is a <br />file that contains parameter information for GUI components. For example: <br />quit-button.color:blue <br />quit-button.width:100 <br />quit-button.height:20 <br />quit-button.border:2 <br />quit-button.label:"Quit" <br />This type of resource file is used by the X Window System (see the file and the <br />.Xdefaults <br /> directory) and Microsoft Windows (see the files). Note <br />/usr/lib/X11/app-defaults .INI <br />that these files may also contain non-GUI information for specific applications. The purpose of such <br />a file is to allow the end-user to modify the attributes of GUI components without having to <br />recompile the application. The general precedence associated with setting GUI resources is as <br />follows: <br />(1)Use resources set on the command line for the application. <br />(2)Use resources set in user's resource file. <br />(3)Use resources set by system resource file (applies to all users on system). <br />(4)Use resources set within program. <br />The low-level GUI routines of the GUI builder library, on which all other routines are built, typically <br />include some type of database for GUI component resources. For example, each GUI component has <br />a color, size, and position. Default values are set within the program or are assumed to be set by the <br />system (such as by a window manager that controls the general look and feel of all applications). <br />The default values can be set by the user to satisfy that user. <br />3 <br />A275 07.28.94 1.05-15 Malers <br />