uigetpref
Create dialog box that opens according to user preference
Syntax
Description
creates
a nonmodal
dialog box that opens with the specified group name and preference name. The group
and preference names, in combination, uniquely identify the dialog box. The dialog
box contains: pval
= uigetpref(group
,pref
,title
,quest
,pbtns
)
The specified question (
quest
) and one or more buttons (pbtns
) that enable the dialog box user to answer the question. The clicked button value is returned aspval
.A check box that, by default, is labeled Do not show this dialog again.
If the user selects the check box, MATLAB® stores and returns the value of the clicked button as the
preference value (pval
). Subsequent calls to
uigetpref
for the same dialog box, detect that the
preference value was stored and apply that choice without opening the dialog box.
If the user does not select the check box, then MATLAB returns, but does not store the value of the clicked button.
Instead, MATLAB stores the value
'ask'
. MATLAB opens
the specified dialog box on subsequent calls to uigetpref
.
[___] = uigetpref(___,
specifies one or more optional name-value arguments that enable you to do any of the following.Name,Value
)
Customize the check box label.
Specify whether the check box is selected when the dialog box opens.
Provide a help button and the help button callback.
Specify buttons that are not mapped to preference values.
Specify the value that
uigetpref
returns forpval
if the user closes the dialog box without clicking a preference button. For example, this value is returned if the user clicks the dialog box close button (X), presses the keyboard Esc key, or clicks a button that is not mapped to a preference value.
Use this option with any of the output argument combinations in the previous syntaxes.
Examples
Input Arguments
Output Arguments
More About
Tips
uigetpref
creates the specified groups and preferences if they do not currently exist. To delete a preference group you no longer need, use thermpref
function.To get a structure of previously created groups and preferences, use the
getpref
function.After a user selects the Do not show this dialog again check box and closes the dialog box, the dialog box does not open again for the same group and preference. To reenable dialog boxes that are being suppressed set the preference value to
'ask'
using thesetpref
function.Users of your dialog box do not know the group and preference names you specified when creating the dialog box. Therefore, to reenable dialog boxes that are being suppressed by preferences, users can call the
uisetpref
command.Executinguisetpref('clearall')
uisetpref
as shown reenables all preference dialog boxes defined withuigetpref
, not just the most recent one.
Version History
Introduced before R2006a