OpenerView

OpenerView[{expr1,expr2}]

represents an object which displays as an opener, together with expr1 if the opener is closed, and both expr1 and expr2 if it is open.

OpenerView[{expr1,expr2},state]

specifies the state of the opener, with False being closed, and True being open.

Details and Options

  • The opener displays as when closed, and when opened.
  • The opener is displayed at the top left, outside the expri.
  • OpenerView[list,Dynamic[state]] takes the opener state to be specified by the dynamically updated current value of state, with the value of state being reset if the opener is clicked.
  • The following options can be given:
  • Alignment Automatichow to align objects in the display area
    Background Nonebackground color to use
    BaselinePosition Automaticalignment relative to surrounding text
    BaseStyle{}base style specifications for the opener view
    Enabled Automaticwhether controls are enabled
    FrameMargins Automaticmargins inside the overall frame
    ImageMargins 0margins around the display area
    ImageSize Automaticthe overall image size for the display area
  • With the default option setting ImageSize->Automatic, OpenerView leaves space only for the expri currently being displayed. ImageSize->All leaves space for the largest of the expri, so that its overall size does not change.
  • With the default setting BaselinePosition->Automatic, the baseline of the OpenerView is taken to be the baseline of the opener icon.
  • Method->"Active" will cause the active area for the opener to include expr1.
  • The settings for BaseStyle are appended to the default style typically given by the "OpenerView" style in the current stylesheet.

Examples

open allclose all

Basic Examples  (2)

Start in the open setting:

Scope  (6)

OpenerView Content  (4)

Use graphics as content in OpenerView:

OpenerView can contain any expression, including Manipulate:

OpenerView can be nested:

By default, an OpenerView resizes according to its state:

With ImageSize -> All, OpenerView leaves enough space to display without ever resizing:

OpenerView Control  (2)

Start by displaying the open expression:

Connect an OpenerView to a checkbox:

Options  (11)

Alignment  (1)

Different alignments within the view:

Specify Alignment within the ImageSize:

AutoAction  (2)

By default, the opener will not change until you click the opener area:

By setting AutoAction, the opener changes as the mouse moves over the opener area:

Background  (2)

Change the background color:

Change the background color dynamically:

BaselinePosition  (1)

Align with surrounding text:

Enabled  (1)

By default, OpenerView is enabled:

By setting Enabled->False, OpenerView 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 OpenerView:

Method  (1)

Normally, toggling the opener requires clicking the opener directly:

With Method -> "Active", the label can also be clicked to toggle the opener:

Applications  (1)

Show the graphical representation of a clock:

Properties & Relations  (2)

OpenerView is a construction of Opener and PaneSelector:

Dynamic variables only update when visible:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_openerview, organization={Wolfram Research}, title={OpenerView}, year={2016}, url={https://reference.wolfram.com/language/ref/OpenerView.html}, note=[Accessed: 13-November-2024 ]}