GNU Octave: User-Defined Preferences

Previous: GUI Utility Functions, Up: GUI Development [Contents][Index]

### 35.5 User-Defined Preferences

Function File: getpref (group, pref)
Function File: getpref (group, pref, default)
Function File: getpref (group)

  Return the preference value corresponding to the named preference pref in the preference group group.

  The named preference group must be a character string.

  If pref does not exist in group and default is specified, return default.

  The preference pref may be a character string or a cell array of character strings.

  The corresponding default value default may be any value, or, if pref is a cell array of strings, default must be a cell array of values with the same size as pref.

  If neither pref nor default are specified, return a structure of preferences for the preference group group.

  If no arguments are specified, return a structure containing all groups of preferences and their values.

  See also: addpref, setpref, ispref, rmpref.

Function File: setpref (group, pref, val)

  Set a preference pref to the given val in the named preference group group.

  The named preference group must be a character string.

  The preference pref may be a character string or a cell array of character strings.

  The corresponding value val may be any value, or, if pref is a cell array of strings, val must be a cell array of values with the same size as pref.

  If the named preference or group does not exist, it is added.

  See also: addpref, getpref, ispref, rmpref.

Function File: addpref (group, pref, val)

  Add a preference pref and associated value val to the named preference group group.

  The named preference group must be a character string.

  The preference pref may be a character string or a cell array of character strings.

  The corresponding value val may be any value, or, if pref is a cell array of strings, val must be a cell array of values with the same size as pref.

  See also: setpref, getpref, ispref, rmpref.

Function File: rmpref (group, pref)
Function File: rmpref (group)

  Remove the named preference pref from the preference group group.

  The named preference group must be a character string.

  The preference pref may be a character string or cell array of strings.

  If pref is not specified, remove the preference group group.

  It is an error to remove a nonexistent preference or group.

  See also: addpref, ispref, setpref, getpref.

Function File: ispref (group, pref)
Function File: ispref (group)

  Return true if the named preference pref exists in the preference group group.

  The named preference group must be a character string.

  The preference pref may be a character string or a cell array of character strings.

  If pref is not specified, return true if the preference group group exists.

  See also: getpref, addpref, setpref, rmpref.

Command: prefdir
Command: dir = prefdir

  Return the directory that contains the preferences for Octave.

  Examples:

  Display the preferences directory

      prefdir

  Change to the preferences folder

      cd (prefdir)

  See also: getpref, setpref, addpref, rmpref, ispref.

Command: preferences

  Display the GUI preferences dialog window for Octave.

Previous: GUI Utility Functions, Up: GUI Development [Contents][Index]