Skip to content

API turboframe.ui.localmenu

rafageist edited this page Dec 4, 2026 · 4 revisions

turboframe.ui.localmenu

Source: turboframe/ui/localmenu.py. Generated from the code of TurboFrame 0.3.0 by tools/wiki_api.py.

Borland's local menu: Alt+F10 (or a right click) on a view opens a menu of what can be done with what is under its bar, at that place on the screen.

LocalMenu(menu, at) is a modal screen with a MenuBox at the screen position at (moved to stay on the screen: above the place when there is no room below). It dismisses with the command of the item chosen, or None when the menu is closed (Esc, a click outside it). From a worker:

command = await pop_local_menu(app, Menu([MenuItem("~O~pen", CM_OPEN, "Enter")]), (x, y))

Contents

LocalMenu, menu_commands, pop_local_menu

class LocalMenu

class LocalMenu(ModalScreen)
LocalMenu(menu: Menu, at: tuple[int, int])

A MenuBox at a screen position; dismisses with the chosen command (or None).

menu_commands

def menu_commands(menu: Menu) -> set[int]

The commands of menu's enabled items (not of its separators, disabled items or submenus).

pop_local_menu

async def pop_local_menu(app, menu: Menu, at: tuple[int, int]) -> int | None

Show menu at at and return the command chosen (None: closed). Call from a worker.

Clone this wiki locally