Tickit...::Menu(3pm)
π Tickit::Widget::Menu β display a menu of choices π
okay so bestie, this is page Tickit...::Menu(3pm) from the User Contributed Perl Documentation, and it's literally all about Tickit::Widget::Menu. It's giving menu widget, it's giving choices, it's giving transient pop-up realness. π
β¨
πΈ NAME πΈ
Tickit::Widget::Menu β display a menu of choices π
β¨ SYNOPSIS β¨
use Tickit;
use Tickit::Widget::Menu;
my $tickit = Tickit->new;
my $menu = Tickit::Widget::Menu->new(
items => [
Tickit::Widget::Menu::Item->new(
name => "Exit",
on_activate => sub { $tickit->stop }
),
],
);
$menu->popup( $tickit->rootwin, 5, 5 );
$tickit->run;
π¦ DESCRIPTION π¦
This widget class is a display container for a list of items that each represent an individual choice. It can show up as a floating window using the popup method, or it can be attached to a Tickit::Widget::MenuBar or used as a child menu inside another Tickit::Widget::Menu. π
This widget is meant to be displayed transiently β either as a pop-up menu over some other widget, or as a child menu of another menu or an instance of a menu bar. And fr fr, pay attention here: such objects should not be directly added to container widgets. ππ
π STYLE π
The default style pen is used as the widget pen. The following style pen prefixes are also used:
highlight => PENβ the pen used to highlight the active menu selection π
The following style actions are used:
highlight_next(<Down>) andhighlight_prev(<Up>) β highlight the next or previous item π¦activate(<Enter>) β activate the highlighted item π₯dismiss(<Escape>) β dismiss the menu πΈ
π CONSTRUCTOR π
π new
$menu = Tickit::Widget::Menu->new( %args )
Constructs a new Tickit::Widget::Menu object. Slay. β¨
It takes the following named arguments:
name => STRINGβ optional. If present, gives the name of the menu item for a submenu. Not used in a top-level menu. πitems => ARRAYβ optional. If present, contains a list ofTickit::Widget::Menu::ItemorTickit::Widget::Menuobjects to add to the menu. Equivalent to passing each to thepush_itemmethod after construction. π
π separator
$separator = Tickit::Window::Menu->separator
Returns a special menu item which draws a separation line between its neighbours. Cute divider energy, honestly. π
π METHODS π
π name
$name = $menu->name
Returns the string name for the menu.
πΈ items
@items = $menu->items
Returns the list of items currently stored.
π¦ push_item
$menu->push_item( $item )
Adds another item.
Each item may either be created using Tickit::Window::Menu::Item's constructor, another Tickit::Widget::Menu item itself (to create a submenu), or the special separator value.
β¨ highlight_item
$menu->highlight_item( $idx )
Gives the selection highlight to the item at the given index. This may be called before the menu is actually displayed in order to pre-select the highlight initially.
π₯ popup
$menu->popup( $win, $line, $col )
Makes the menu appear at the given position relative to the given window. Note that as $win->make_popup is called, the menu is always displayed in a popup window, floating over the root window. The passed window is used simply as the origin for the given line and column position. π
π dismiss
$menu->dismiss
Hides a menu previously displayed using popup.
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk> π«Ά
source/version: perl v5.42.2; date: 2026-02-15 β byeee bestie, stay hydrated and close your popups properly πβ¨
π¦ where this page comes from
- alpine 3.24: perl-tickit-widget-menu-doc 0.16-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms