reckfellENGINE

MenuButton

Button opening a command menu without a persistent selected item.

On this page
class MenuButtonReckfellSharpInherits Button

MenuButton opens its owned PopupMenu. Obtain it through GetPopup, populate commands and connect the menu’s IdPressed to run a command by ID. The button’s Pressed means opening/closing activation rather than command selection. Use OptionButton for persistent selection.

The constructor sets Flat = true, ToggleMode = true, ActionMode = Press and FocusMode = Accessibility. Set FocusMode = All for ordinary Tab navigation. Toggle state follows popup visibility rather than an application setting. ItemCount changes PopupMenu row count without supplying meaningful labels or actions.

AboutToPopup is emitted before ShowPopup displays the menu; use it to refresh command availability/content. ShowPopup requires a Viewport and directly opens the menu, bypassing Press’s Disabled check. Call it for an active element inside the tree. GetPopup returns a shared internal object — do not free or reparent it.

SwitchOnHover defaults to false. Enabling it on related MenuButtons before opening allows an already open menu to switch to another eligible button on hover. It does not open the first menu on arbitrary hover. SetDisableShortcuts disables local shortcut handling for this button/menu rather than global InputMap actions.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

MenuButtonConstructor
# MenuButton
C#
public MenuButton();

Creates a flat toggle button with ActionMode = Press, FocusMode = Accessibility and hidden internal PopupMenu. SwitchOnHover = false.

Properties2

ItemCountProperty
# ItemCount
C#
public int ItemCount { get; set; }

Internal PopupMenu row count. Nonnegative setter adds empty rows or truncates the tail. Populate labels, IDs and actions separately through GetPopup.

SwitchOnHoverProperty
# SwitchOnHover
C#
public bool SwitchOnHover { get; set; }

Allows hover switching between related already open MenuButtons, default false. Configure before opening; does not open the first menu on ordinary hover.

Methods7

GetItemCountint
# GetItemCount
C#
public int GetItemCount();

Internal PopupMenu row count. Nonnegative setter adds empty rows or truncates the tail. Populate labels, IDs and actions separately through GetPopup.

Returns int

Count of all rows including separators.

GetPopupPopupMenu
# GetPopup
C#
public PopupMenu GetPopup();

Returns the button-owned internal PopupMenu. Populate commands and handle its IdPressed there. Do not free/reparent separately.

Returns PopupMenu

Shared internal PopupMenu owned by the button.

IsSwitchOnHoverbool
# IsSwitchOnHover
C#
public bool IsSwitchOnHover();

Allows hover switching between related already open MenuButtons, default false. Configure before opening; does not open the first menu on ordinary hover.

Returns bool

true when hover switching between open menus is configured.

SetDisableShortcutsvoid
# SetDisableShortcuts
C#
public void SetDisableShortcuts(bool disabled);

Disables local list/base-button shortcut handling. Does not change application InputMap or disable ordinary Select/list methods.

Parameters
NameTypeDefault
disabledbool—
disabled

Disables local list/base-button shortcut handling. Does not change application InputMap or disable ordinary Select/list methods.

SetItemCountvoid
# SetItemCount
C#
public void SetItemCount(int count);

Internal PopupMenu row count. Nonnegative setter adds empty rows or truncates the tail. Populate labels, IDs and actions separately through GetPopup.

Parameters
NameTypeDefault
countint—
count

Internal PopupMenu row count. Nonnegative setter adds empty rows or truncates the tail. Populate labels, IDs and actions separately through GetPopup.

SetSwitchOnHovervoid
# SetSwitchOnHover
C#
public void SetSwitchOnHover(bool enable);

Allows hover switching between related already open MenuButtons, default false. Configure before opening; does not open the first menu on ordinary hover.

Parameters
NameTypeDefault
enablebool—
enable

Allows hover switching between related already open MenuButtons, default false. Configure before opening; does not open the first menu on ordinary hover.

ShowPopupvoid
# ShowPopup
C#
public void ShowPopup();

Directly opens PopupMenu when a Viewport exists, first emitting AboutToPopup. Does not check Disabled as Press does; use for an active in-tree element.

Signals and events1

AboutToPopupEvent
# AboutToPopup
C#
public event Action AboutToPopup;

Emitted before ShowPopup displays the menu. Suitable for refreshing command content/availability; does not report command selection.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.