class

MMenuBar

Module
Miri
Header
#include "Miri/Widgets/MMenuBar.h"
Namespace
Miri

Public functions

ReturnsNameDescription
MIRI_WIDGET_ARGS
voidAddMenu
voidAddMenu
voidClearMenus
int32_tGetMenuCount
boolIsMenuOpen
int32_tGetOpenMenuIndexThe open menu's index, or -1; a menu the stack closed meanwhile (Escape, a click elsewhere) reads as closed.
MiriRectGetTriggerRectWhere a title sits inside the bar's geometry.
MiriVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseMove
CReplyOnMouseButtonDown
CReplyOnKeyDown
voidOnMouseLeave
const char*GetTypeName
const std::vector<CMenuBarEntry>&GetMenusThe raw menu model — read by hosts that mirror this bar into a native menu (the macOS application menu bar).

Function details

MIRI_WIDGET_ARGS

C++
MIRI_WIDGET_ARGS(MMenuBar) MIRI_ATTR(float, BarHeight) MIRI_WIDGET_ARGS_END() void Construct(const CArguments& args)

AddMenu

C++
void AddMenu(const CText& label, std::vector<CMenuEntry> entries)

AddMenu

C++
void AddMenu(const CText& label, const CMenuBuilder& builder)

ClearMenus

C++
void ClearMenus()

GetMenuCount

C++
int32_t GetMenuCount() const

IsMenuOpen

C++
bool IsMenuOpen() const

GetOpenMenuIndex

C++
int32_t GetOpenMenuIndex() const

The open menu's index, or -1; a menu the stack closed meanwhile (Escape, a click elsewhere) reads as closed.

GetTriggerRect

C++
MiriRect GetTriggerRect(const CGeometry& geo, int32_t index) const

Where a title sits inside the bar's geometry.

ComputeDesiredSize

C++
MiriVec2 ComputeDesiredSize(float scale) const override

OnPaint

C++
int32_t OnPaint(const CMiriPaintArgs& args, const CGeometry& geo, CMiriRenderer& renderer, int32_t layerId) const override

OnMouseMove

C++
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) override

OnMouseButtonDown

C++
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) override

OnKeyDown

C++
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) override

OnMouseLeave

C++
void OnMouseLeave(const CPointerEvent& event) override

GetTypeName

C++
const char* GetTypeName() const override

GetMenus

C++
const std::vector<CMenuBarEntry>& GetMenus() const

The raw menu model — read by hosts that mirror this bar into a native menu (the macOS application menu bar).

Generated from Miri/Widgets/MMenuBar.h via miri.json · Dec 5, 2026Version 1.1.0