Menu(3I)
β¨ NAME β¨
Menu, MenuItem, MenuBar, PopupMenu, PulldownMenu, PullrightMenu β menus, bestie π
πΈ SYNOPSIS πΈ
#include <InterViews/menu.h>
π DESCRIPTION π
okay so N.B. and I need you to actually read this one: this Menu class is completely different from the Menu class in version 2.5. nobody even tried to be compatible, and honestly? good for them, because this class and its subclasses are more powerful and easier to use than the original one. glow-up of the century fr fr π
Menu is a subclass of Control that contains a scene of other controls, and that scene is called its body. when a menu is opened, it inserts the body into the world with a drop shadow (yes, shadows, we love a dramatic entrance β¨). the appearance of the menu itself is defined by its interactor component. for example, a menu in a menu bar might appear as File and insert a pulldown menu with commands such as Save when opened. iconic behaviour honestly.
MenuItem is a subclass of Control for defining the leaves of a menu hierarchy. normally, an application will derive a command class from MenuItem and implement the virtual function Do as appropriate. one technique is to pass the Command an application object and pointer to member function; the Do function calls the member function on the application object. iykyk π§
PopupMenu, PulldownMenu, and PullrightMenu are subclasses of Menu that implement common styles of menus. MenuBar is a subclass of HBox that manages the control state associated with a set of menus. PopupMenu has no appearance β it gets opened explicitly in response to an input event. PulldownMenu and PullrightMenu open the menu body below and to the right of the menu, respectively. these classes make it possible to use menus in an application without creating or passing control states explicitly. that's the whole point, bestie π«Ά
π PUBLIC OPERATIONS π
Menu::Menu(Interactor*)β construct a new menu. slay.Menu::~Menu()β the destructor deletes the menu body in addition to its appearance component. it's giving cleanup crew π§Ήvirtual void Menu::Include(Control*)β add an item to the menu. if no scene is specified,Menuwill create a vbox and insert items into it. automatic, we love a self-starter πvirtual void Menu::Popup(Event&)β insert the body into the world centered around the coordinates associated with the event and activate the controls in the body. the menu is removed from the world when the controls are deactivated (normally when a button is released). in and out, main character energy πvoid Menu::SetBody(Interactor*)Interactor* Menu::GetBody()void Menu::SetAlign(Alignment)Alignment Menu::GetAlign()void Menu::SetDepth(int)int GetDepth()void Menu::SetBodyState(ControlState*)ControlState* Menu::GetBodyState()void Menu::SetScene(Scene*)Scene* Menu::GetScene()
set or get attributes of the menu. the depth of a menu is the number of pixels separating the body and the drop shadow. π
Coord Menu::InsertX()Coord Menu::InsertY()
return the coordinates where the menu's body was last inserted into the world. receipts of where it last showed up, periodt π
MenuItem::MenuItem(Interactor*)MenuItem::MenuItem(const char* str, Alignment = Left)
construct a new menu item. the second constructor defines the appearance of the item to be a message containing the text in str. cute little label moment π
PulldownMenu::PulldownMenu(Interactor*)PulldownMenu::PulldownMenu(const char* str)PullrightMenu::PullrightMenu(Interactor*)PullrightMenu::PullrightMenu(const char* str)
construct a new pulldown or pullright menu. the second constructor defines the appearance of the menu to be a message containing the text in str. β¨
PopupMenu::PopupMenu()β construct a new popup menu. no appearance, all vibes π¦MenuBar::MenuBar()β construct a new menu bar. the crown of the whole operation πvirtual void MenuBar::Include(Control*)β add a control to a menu bar. in addition to inserting the control into the bar's hbox, this operation attaches the control to the bar's control state. two jobs, one method, she's doing both πͺ
π₯ SEE ALSO π₯
Control(3I), Event(3I)
okay that's the whole page bestie!! π this one came from the InterViews reference manual, and it's dated 6 December 1989 β like, vintage vintage, but the API still ate and left no crumbs. go forth and build menus πΈπ«Άβ¨
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms