Shawn Boyette > Curses-UI-0.9609 > Curses::UI::Popupmenu

Download:
Curses-UI-0.9609.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  35
Open  6
View/Report Bugs
Module Version: 1.0011   Source  

NAME ^

Curses::UI::Popupmenu - Create and manipulate popupbox widgets

CLASS HIERARCHY ^

 Curses::UI::Widget
    |
    +----Curses::UI::Popupmenu

SYNOPSIS ^

    use Curses::UI;
    my $cui = new Curses::UI;
    my $win = $cui->add('window_id', 'Window');

    my $popupbox = $win->add(
        'mypopupbox', 'Popupmenu',
        -values    => [1, 2, 3],
        -labels    => { 1 => 'One', 
                        2 => 'Two', 
                        3 => 'Three' },
    );

    $popupbox->focus();
    my $value = $popupbox->get();

DESCRIPTION ^

Curses::UI::Popupmenu is a widget that can be used to create something very similar to a basic Curses::UI::Listbox. The difference is that the widget will show only the currently selected value (or "-------" if no value is yet selected). The list of possible values will be shown as a separate popup window if requested.

Normally the widget will look something like this:

 [Current value ]

If the popup window is opened, it looks something like this:

 [Current value ]
 +--------------+
 |Other value   |
 |Current value | 
 |Third value   |
 +--------------+

STANDARD OPTIONS ^

-parent, -x, -y, -width, -height, -pad, -padleft, -padright, -padtop, -padbottom, -ipad, -ipadleft, -ipadright, -ipadtop, -ipadbottom, -title, -titlefullwidth, -titlereverse, -onfocus, -onblur

For an explanation of these standard options, see Curses::UI::Widget.

WIDGET-SPECIFIC OPTIONS ^

METHODS ^

DEFAULT BINDINGS ^

There are bindings for the widget itself and bindings for the popup listbox that can be opened by this widget.

The widget itself

The popup listbox

The bindings for the popup listbox are the same as the bindings for the Listbox widget. So take a look at Curses::UI::Listbox for a description of these. The difference is that the 'loose-focus' and 'option-select' routine will have the popup listbox to close. If the routine 'option-select' is called, the active item will get selected.

SEE ALSO ^

Curses::UI, Curses::UI::Listbox Curses::UI::Widget, Curses::UI::Common

AUTHOR ^

Copyright (c) 2001-2002 Maurice Makaay. All rights reserved.

Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de)

This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the same terms as perl itself.

syntax highlighting: