PopUpMenu:
Filter:
Classes | GUI > Views

PopUpMenu

A view displaying a text item selectable from a drop-down menu.
Location: NOT INSTALLED!

Description

When clicked, this view opens a menu containing several text items, then closes the menu and displays one of the items after it is selected.

Class Methods

Inherited class methods

Instance Methods

Data

.items

The list of items displayed in a menu when the view is clicked.

Arguments:

An Array of Strings or Symbols.

.clear

Removes all items.

.item

The currently selected item.

Returns:

A String.

.value

The index of the currently selected item.

Arguments:

An integer, or nil meaning no selected item.

.valueAction

Sets -value and triggers -action.

Arguments:

An integer, or nil meaning no selected item.

Appearance

.stringColor

The color used to display text.

Arguments:

A Color.

.background

Setting this variable colors the area of the view under the text with the given color.

Arguments:

A Color.

Interaction

.allowsReselection

Determines whether the action is triggered when selecting already selected item. Defaults to false.

Arguments:

A Boolean.

Actions

.action

The action object evaluated whenever the user changes the selected item from the menu. See -allowsReselection for customization.

Drag and drop

.defaultGetDrag

Returns:

The -value.

.defaultCanReceiveDrag

Returns:

True if the current drag data is a number.

.defaultReceiveDrag

Sets -valueAction to the current drag data.

Inherited instance methods

Examples

Basic Example

Sound Example

Play different functions: