<html lang="en"> <head> <title>User-Defined Preferences - GNU Octave</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="GNU Octave"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="GUI-Development.html#GUI-Development" title="GUI Development"> <link rel="prev" href="GUI-Utility-Functions.html#GUI-Utility-Functions" title="GUI Utility Functions"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="User-Defined-Preferences"></a> <a name="User_002dDefined-Preferences"></a> <p> Previous: <a rel="previous" accesskey="p" href="GUI-Utility-Functions.html#GUI-Utility-Functions">GUI Utility Functions</a>, Up: <a rel="up" accesskey="u" href="GUI-Development.html#GUI-Development">GUI Development</a> <hr> </div> <h3 class="section">35.4 User-Defined Preferences</h3> <!-- addpref scripts/prefs/addpref.m --> <p><a name="doc_002daddpref"></a> <div class="defun"> — Function File: <b>addpref</b> (<var>group, pref, val</var>)<var><a name="index-addpref-3096"></a></var><br> <blockquote><p>Add a preference <var>pref</var> and associated value <var>val</var> to the named preference group <var>group</var>. <p>The named preference group must be a character string. <p>The preference <var>pref</var> may be a character string or a cell array of character strings. The corresponding value <var>val</var> may be any value, or, if <var>pref</var> is a cell array of strings, <var>val</var> must be a cell array of values with the same size as <var>pref</var>. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dsetpref.html#doc_002dsetpref">setpref</a>, <a href="doc_002dgetpref.html#doc_002dgetpref">getpref</a>, <a href="doc_002dispref.html#doc_002dispref">ispref</a>, <a href="doc_002drmpref.html#doc_002drmpref">rmpref</a>. </p></blockquote></div> <!-- getpref scripts/prefs/getpref.m --> <p><a name="doc_002dgetpref"></a> <div class="defun"> — Function File: <b>getpref</b> (<var>group, pref, default</var>)<var><a name="index-getpref-3097"></a></var><br> <blockquote><p>Return the preference value corresponding to the named preference <var>pref</var> in the preference group <var>group</var>. <p>The named preference group must be a character string. <p>If <var>pref</var> does not exist in <var>group</var> and <var>default</var> is specified, return <var>default</var>. <p>The preference <var>pref</var> may be a character string or a cell array of character strings. The corresponding default value <var>default</var> may be any value, or, if <var>pref</var> is a cell array of strings, <var>default</var> must be a cell array of values with the same size as <var>pref</var>. <p>If neither <var>pref</var> nor <var>default</var> are specified, return a structure of preferences for the preference group <var>group</var>. <p>If no arguments are specified, return a structure containing all groups of preferences and their values. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002daddpref.html#doc_002daddpref">addpref</a>, <a href="doc_002dsetpref.html#doc_002dsetpref">setpref</a>, <a href="doc_002dispref.html#doc_002dispref">ispref</a>, <a href="doc_002drmpref.html#doc_002drmpref">rmpref</a>. </p></blockquote></div> <!-- ispref scripts/prefs/ispref.m --> <p><a name="doc_002dispref"></a> <div class="defun"> — Function File: <b>ispref</b> (<var>group, pref</var>)<var><a name="index-ispref-3098"></a></var><br> <blockquote><p>Return true if the named preference <var>pref</var> exists in the preference group <var>group</var>. <p>The named preference group must be a character string. <p>The preference <var>pref</var> may be a character string or a cell array of character strings. <p>If <var>pref</var> is not specified, return true if the preference group <var>group</var> exists. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002dgetpref.html#doc_002dgetpref">getpref</a>, <a href="doc_002daddpref.html#doc_002daddpref">addpref</a>, <a href="doc_002dsetpref.html#doc_002dsetpref">setpref</a>, <a href="doc_002drmpref.html#doc_002drmpref">rmpref</a>. </p></blockquote></div> <!-- rmpref scripts/prefs/rmpref.m --> <p><a name="doc_002drmpref"></a> <div class="defun"> — Function File: <b>rmpref</b> (<var>group, pref</var>)<var><a name="index-rmpref-3099"></a></var><br> <blockquote><p>Remove the named preference <var>pref</var> from the preference group <var>group</var>. <p>The named preference group must be a character string. <p>The preference <var>pref</var> may be a character string or a cell array of character strings. <p>If <var>pref</var> is not specified, remove the preference group <var>group</var>. <p>It is an error to remove a nonexistent preference or group. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002daddpref.html#doc_002daddpref">addpref</a>, <a href="doc_002dispref.html#doc_002dispref">ispref</a>, <a href="doc_002dsetpref.html#doc_002dsetpref">setpref</a>, <a href="doc_002dgetpref.html#doc_002dgetpref">getpref</a>. </p></blockquote></div> <!-- setpref scripts/prefs/setpref.m --> <p><a name="doc_002dsetpref"></a> <div class="defun"> — Function File: <b>setpref</b> (<var>group, pref, val</var>)<var><a name="index-setpref-3100"></a></var><br> <blockquote><p>Set a preference <var>pref</var> to the given <var>val</var> in the named preference group <var>group</var>. <p>The named preference group must be a character string. <p>The preference <var>pref</var> may be a character string or a cell array of character strings. The corresponding value <var>val</var> may be any value, or, if <var>pref</var> is a cell array of strings, <var>val</var> must be a cell array of values with the same size as <var>pref</var>. <p>If the named preference or group does not exist, it is added. <!-- Texinfo @sp should work but in practice produces ugly results for HTML. --> <!-- A simple blank line produces the correct behavior. --> <!-- @sp 1 --> <p class="noindent"><strong>See also:</strong> <a href="doc_002daddpref.html#doc_002daddpref">addpref</a>, <a href="doc_002dgetpref.html#doc_002dgetpref">getpref</a>, <a href="doc_002dispref.html#doc_002dispref">ispref</a>, <a href="doc_002drmpref.html#doc_002drmpref">rmpref</a>. </p></blockquote></div> <!-- DO NOT EDIT! Generated automatically by munge-texi.pl. --> <!-- Copyright (C) 1996-2012 John W. Eaton --> <!-- This file is part of Octave. --> <!-- Octave is free software; you can redistribute it and/or modify it --> <!-- under the terms of the GNU General Public License as published by the --> <!-- Free Software Foundation; either version 3 of the License, or (at --> <!-- your option) any later version. --> <!-- Octave is distributed in the hope that it will be useful, but WITHOUT --> <!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or --> <!-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --> <!-- for more details. --> <!-- You should have received a copy of the GNU General Public License --> <!-- along with Octave; see the file COPYING. If not, see --> <!-- <http://www.gnu.org/licenses/>. --> </body></html>