[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

Applications can obtain a copy of Preferences by calling the Intuition
function GetPrefs().  In a system in which there is no
devs:system-configuration file, GetDefPrefs() can be used to obtain the
Intuition default Preference settings.

    struct Preferences *GetPrefs(struct Preferences *preferences,
                                 LONG size);
    struct Preferences *GetDefPrefs(struct Preferences *preferences,
                                    LONG size);

GetPrefs() and GetDefPrefs() have two arguments, a pointer to a buffer to
receive the copy of the user Preferences and the size of this buffer.  The
most commonly used data is grouped near the beginning of the Preferences
structure and you are free to read only as much as you need.  So, if you
are only interested in the first part of the Preferences structure, you do
not need to allocate a buffer large enough to hold the entire structure.
These functions return a pointer to your buffer if successful, NULL
otherwise.

If you are using Intuition IDCMP for input, you can set the IDCMP flag
IDCMP_NEWPREFS (formerly the NEWPREFS flag under V34 and earlier versions
of the OS).  With this flag set, your program will receive an IntuiMessage
informing you changes have been made to Preferences.  To get the latest
settings, you would again call GetPrefs().