Another resource file is used to determine the resources of a MGUI program. This file is located in same directory where the executable resides (in the user's home directory under Unix) and has the same name of the program, with the appropriate extension (.progname under Unix).
The application's resource database is constructed at program startup by merging all option definitions in the MGUI resource file and then those in the application's resource file. By defining in the application's resource file a resource already defined in the MGUI resource file, you overwrite its previous value.
A resource is identified by the combination of an object name and a resource (option) name. Valid resources for GUI object are the following attributes: background/foreground colors, font, text and shadow. The Object font resource must be expressed as a static font name (eg: TIMES_LARGE or FIXED_MEDIUM).
All resources are loaded at program startup, Object resources are enabled via the function call MObjectEnableOptions(), after the Object creation. For example, the code:
label = MCreateLabel(mainshell,
"Ctrl+Shift+MouseClick here to customize",
MObjectEnableOptions(label, "label_1", MO_ALL);
will cause the Object label to be customized with all available resources for the object named label_1. Object resources, enabled via MObjectEnableOptions(), can be saved in the application's resource file at any time by using the call MObjectSaveOptions().
MGUI provides a run-time advanced feature that lets the user change, and optionally store in the application file, the resources enabled for a given Object. This can be done via a dialog window open by clicking the mouse button in an enabled Object while holding down the <Ctrl+Shift> keys.
The library API also lets the programmer load/save general application resources, by specifying arbitrary object and resource names.