Curses::UI::Popupmenu(3pm) - phpMan

Command: man perldoc info search(apropos)  


Curses::UI::Popupmenu(3)       User Contributed Perl Documentation       Curses::UI::Popupmenu(3)



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
       o   -values < LIST >

       o   -labels < HASHREF >

       o   -selected < INDEX >

       o   -wraparound < BOOLEAN >

           These options are exactly the same as the options for the Listbox widget. So for an
           explanation of these, take a look at Curses::UI::Listbox.

       o   -onchange < CODEREF >

           This sets the onChange event handler for the popupmenu widget.  If a new item is
           selected, the code in CODEREF will be executed.  It will get the widget reference as
           its argument.

METHODS
       o   new ( OPTIONS )

       o   layout ( )

       o   draw ( BOOLEAN )

       o   intellidraw ( )

       o   focus ( )

       o   onFocus ( CODEREF )

       o   onBlur ( CODEREF )

           These are standard methods. See Curses::UI::Widget for an explanation of these.

       o   get ( )

           This method will return the currently selected value.

       o   onChange ( CODEREF )

           This method can be used to set the -onchange event handler (see above) after
           initialization of the popupmenu.

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
       o   <tab>

           Call the 'loose-focus' routine. This will have the widget loose its focus.

       o   <enter>, <cursor-right, <l>, <space>

           Call the 'open-popup' routine. This will show the popup listbox and bring the focus to
           this listbox. See The popup listbox below for a description of the bindings for this
           listbox.

       o   <cursor-down>, <j>

           Call the 'select-next' routine. This will select the item in the list that is after
           the currently selected item (unless the last item is already selected). If no item is
           selected, the first item in the list will get selected.

       o   <cursor-up>, <k>

           Call the 'select-prev' routine. This will select the item in the list that is before
           the currently selected item (unless the first item is already selected). If no item is
           selected, the first item in the list will get selected.

   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 AT cpan.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.



perl v5.16.3                                2011-09-01                   Curses::UI::Popupmenu(3)

Generated by $Id: phpMan.php,v 4.55 2007/09/05 04:42:51 chedong Exp $ Author: Che Dong
On Apache
Under GNU General Public License
2024-04-20 08:20 @18.225.117.183 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0!Valid CSS!