NAME
TUI::Menus::MenuPopup - pop-up menu with keyboard shortcut handling
HIERARCHY
TObject
TView
TMenuView
TMenuBox
TMenuPopup
SYNOPSIS
use TUI::Menus;
use TUI::Objects;
my $bounds = TRect->new( ax => 10, ay => 5, bx => 40, by => 12 );
my $menu = new_TMenu(
new_TMenuItem( '~A~dd Watch', 300, 0 ) +
new_TMenuItem( '~D~elete Watch', 301, 0 ),
);
my $popup = new_TMenuPopup( $bounds, $menu );
my $command = $desktop->execView( $popup );
DESCRIPTION
TMenuPopup is a specialized menu box for standalone pop-up menus. In addition to the keyboard navigation provided by TMenuBox, it activates menu items using Ctrl mnemonics and supports menu-item hot keys. Unmatched Alt keystrokes are consumed by the popup.
Commonly Used Features
Construct a popup with "new_TMenuPopup", providing its bounds and a menu built from new_TMenu and new_TMenuItem. Pass it to $desktop->execView to display it and receive the selected command.
CONSTRUCTOR
new
my $popup = TMenuPopup->new( bounds => $bounds, menu => $menu );
Creates a pop-up menu view.
- bounds
-
Bounding rectangle of the menu view (TRect).
-
Menu structure defining the items displayed by the pop-up (TMenu). This parameter is required but may be
undef.
new_TMenuPopup
my $popup = new_TMenuPopup($bounds, $menu);
Factory-style constructor using positional arguments.
METHODS
handleEvent
$popup->handleEvent($event);
Processes Ctrl mnemonic and menu-item hot-key events before delegating menu navigation and selection to TMenuBox.
SEE ALSO
TMenuBox, TMenuView, TMenuItem
AUTHORS
Borland International (original Turbo Vision design)
J. Schneider <brickpool@cpan.org> (Perl implementation and maintenance)
COPYRIGHT AND LICENSE
Copyright (c) 1990-1994, 1997 by Borland International
Copyright (c) 2021-2026 the "AUTHORS" as listed above.
This software is licensed under the MIT license (see the LICENSE file, which is part of the distribution).