Contents Up Previous Next

User preferences

In both X and Windows, there are mechanisms for handling user preferences, or resources. Under X, there is a global .Xdefaults file plus inidividual application defaults files. Under Windows, either win.ini or application specific .ini files are used.

wxWindows unifies these with wxGetResource and wxWriteResource functions: section, entry, value and file arguments may be specified.

In X, a section is the first word in a resource specification; in Windows, this is enclosed in square brackets on a line of its own. In X, an entry is taken to mean the rest of a resource specification, and in Windows this is a name followed by an equals character. The value is an arbitrary string in both cases, although wxWindows overloads the resource functions for commonly used types.

If the resource filename is omitted, the main resource file is assumed (.Xdefaults or win.ini). Under X, if an application class (wxApp::wx_class) has been defined, it is appended to the string /usr/lib/X11/app-defaults/ to try to find an applications default file when merging all resource databases.