|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
ListPicker
ListPicker[list, {val1, val2, ...}]
represents a list pane with setting list that can contain possible values
.
ListPicker[Dynamic[list], {val1, ...}]
takes the setting to be the dynamically updated current value of list, with members added or removed each time an item is selected or deselected.
ListPicker[list, {val1->lbl1, val2->lbl2, ...}]
represents a list pane in which the possible value
is indicated by
.
Details and OptionsDetails and Options
- ListPicker displays as a vertical list of items. By default, it displays using the default system appearance of a list box or list view.
- Holding the Shift key while clicking on a ListPicker will add a range of items to the selection. Holding the Ctrl or Command key will toggle the selection of an individual item.
- list contains all of the selected values. If no values are selected, then list will be an empty list.
- The
and
can be strings, boxes, graphics, or any other expressions, including dynamic expressions. - Delimiter can be used in the list of
to specify a horizontal delimiter in the displayed list pane. - The following options can be given:
-
Appearance Automatic the overall appearance of the pane AppearanceElements Automatic overall control elements to include in the displayed output Background Automatic background color to use BaselinePosition Automatic alignment relative to surrounding text BaseStyle {} base style specifications for the pane ContentPadding True whether to shrink the margins tightly around the contents Enabled Automatic whether the pane is enabled or grayed out FieldSize {{1.,50.},{1.,10.}} - the size of the field for list items
FrameMargins Automatic margins to leave inside the menu frame ImageMargins 0 margins around the displayed menu ImageSize Automatic the overall image size of the displayed list pane Multiselection True whether to allow simultaneous selection of multiple items Scrollbars Automatic whether to include scrollbars ScrollPosition {0,0} scroll position if scrolling is enabled Spacings Automatic vertical spacings - The settings for Background can be given as follows to apply separately to successive items in the control:
-
{s1,s2,...,sn} use
through
, then use defaults {{c}} use c in all cases {{c1,c2}} alternate between
and
{{c1,c2,...}} cycle through all 
{s,{c}} use s, then repeatedly use c {s1,{c},sn} use
, then repeatedly use c, but use
at the end {s1,s2,...,{c1, c2, ... }, sm, ... , sn}use the first sequence of
at the beginning, then cyclically use the
, then use the last sequence of
at the end {s1,s2,...,{},sm,...,sn} use the first sequence of
at the beginning and the last sequence at the end{i1->v1,i2->v2,...} specify what to use at positions 
{spec,rules} use rules to override specifications in spec - With settings of the form
, if there are more
specified than items across the list picker,
from the beginning are used for the first items, and ones from the end are used for the last items. - Possible settings for Appearance include
and
. - Possible elements for AppearanceElements include
. - The BaselinePosition is by default taken to be Center->Axis.
- The settings for BaseStyle are appended to the default style typically given by the
style in the current stylesheet.
ExamplesExamplesopen allclose all
Basic Examples (3)Basic Examples (3)
Select values from a list pane:
| In[1]:= |
| Out[1]= |
Initialize given values to be selected:
| In[1]:= |
| Out[1]= |
Connect ListPicker to a dynamic state:
| In[1]:= |
| Out[1]= | ![]() |
New in 9
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »

