MenuView

MenuView[{lbl1expr1,lbl2expr2,}]

represents an object in which selecting the menu item with label lbli displays expri.

MenuView[{lbl1expr1,lbl2expr2,},i]

makes the i^(th) item be the one currently selected.

MenuView[{{v1,lbl1expr1},{v2,lbl2expr2},},v]

associates values vi with successive menu items, and makes the item with value v be the one currently selected.

MenuView[{expr1,expr2,}]

takes the menu items' labels to be successive integers.

Details and Options

  • MenuView[list,Dynamic[s]] takes the selected menu item to be specified by the dynamically updated current value of s, with the value of s being reset if a different menu item is selected.
  • The following options can be given:
  • Alignment {Left,Top}how to align objects in the display area
    Background Nonebackground color to use
    BaselinePosition Automatichow to align with a surrounding text baseline
    BaseStyle{}base style specifications for the menu
    ControlPlacement {Top,Left}where to place the menu
    Deployed Falsewhether the contents should be uneditable
    Enabled Automaticwhether the menu is enabled or grayed out
    FrameMargins Automaticmargins inside the overall frame
    ImageMargins Automaticmargins around the display area
    ImageSize Allthe overall image size for the display area
    LabelStyle{}style specifications for the menu items
  • With the default option setting ImageSize->All, MenuView always leaves space for the largest of the expri to be displayed, so that its overall size does not change.
  • With ImageSize->Automatic, MenuView leaves space only for the expri currently being displayed.
  • If any of the lbli are Null, the corresponding menu items are left blank.
  • Item can be used to give style specifications that apply throughout a menu item.
  • MenuView by default displays the lbli in "MenuView" style, which typically uses the system menu font.
  • The settings for BaseStyle and LabelStyle are appended to the default styles typically given by the "MenuView" and "MenuViewLabel" styles in the current stylesheet.

Examples

open allclose all

Basic Examples  (1)

Select between graphics using a menu:

Include labels:

Scope  (7)

MenuView Content  (4)

Use graphics as content in MenuView:

MenuView can contain any expression, including Manipulate:

MenuView can be nested:

By default, MenuView leaves enough space to display without ever resizing:

With ImageSize->Automatic, MenuView resizes for each pane:

MenuView Control  (3)

Start by displaying the third slide:

The setting is based on position:

Connect MenuView to a slider:

Options  (9)

Alignment  (1)

Choose alignments within the view:

Background  (1)

Change the background color:

BaselinePosition  (1)

Align with surrounding text:

ControlPlacement  (1)

Alter the control placement:

Deployed  (1)

By setting Deployed, objects in the display of MenuView may not be selected:

Enabled  (1)

By default, MenuView is enabled:

By setting Enabled->False, MenuView is disabled, but visible in its current state:

FrameMargins  (1)

Add margins within the view:

ImageMargins  (1)

Add margins outside the view:

ImageSize  (1)

Control the overall size of MenuView:

Applications  (2)

Create a MenuView of series expansions:

Create a MenuView of some of the aerial images available from ExampleData:

Properties & Relations  (1)

MenuView is constructed with PopupMenu:

Wolfram Research (2007), MenuView, Wolfram Language function, https://reference.wolfram.com/language/ref/MenuView.html (updated 2008).

Text

Wolfram Research (2007), MenuView, Wolfram Language function, https://reference.wolfram.com/language/ref/MenuView.html (updated 2008).

CMS

Wolfram Language. 2007. "MenuView." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008. https://reference.wolfram.com/language/ref/MenuView.html.

APA

Wolfram Language. (2007). MenuView. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MenuView.html

BibTeX

@misc{reference.wolfram_2024_menuview, author="Wolfram Research", title="{MenuView}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/MenuView.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_menuview, organization={Wolfram Research}, title={MenuView}, year={2008}, url={https://reference.wolfram.com/language/ref/MenuView.html}, note=[Accessed: 22-November-2024 ]}