1Curses::UI::Popupmenu(3U)ser Contributed Perl DocumentatiCounrses::UI::Popupmenu(3)
2
3
4

NAME

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

CLASS HIERARCHY

9        Curses::UI::Widget
10           |
11           +----Curses::UI::Popupmenu
12

SYNOPSIS

14           use Curses::UI;
15           my $cui = new Curses::UI;
16           my $win = $cui->add('window_id', 'Window');
17
18           my $popupbox = $win->add(
19               'mypopupbox', 'Popupmenu',
20               -values    => [1, 2, 3],
21               -labels    => { 1 => 'One',
22                               2 => 'Two',
23                               3 => 'Three' },
24           );
25
26           $popupbox->focus();
27           my $value = $popupbox->get();
28

DESCRIPTION

30       Curses::UI::Popupmenu is a widget that can be used to create something
31       very similar to a basic Curses::UI::Listbox.  The difference is that
32       the widget will show only the currently selected value (or "-------" if
33       no value is yet selected). The list of possible values will be shown as
34       a separate popup window if requested.
35
36       Normally the widget will look something like this:
37
38        [Current value ]
39
40       If the popup window is opened, it looks something like this:
41
42        [Current value ]
43        +--------------+
44        |Other value   |
45        |Current value |
46        |Third value   |
47        +--------------+
48

STANDARD OPTIONS

50       -parent, -x, -y, -width, -height, -pad, -padleft, -padright, -padtop,
51       -padbottom, -ipad, -ipadleft, -ipadright, -ipadtop, -ipadbottom,
52       -title, -titlefullwidth, -titlereverse, -onfocus, -onblur
53
54       For an explanation of these standard options, see Curses::UI::Widget.
55

WIDGET-SPECIFIC OPTIONS

57       ·   -values < LIST >
58
59       ·   -labels < HASHREF >
60
61       ·   -selected < INDEX >
62
63       ·   -wraparound < BOOLEAN >
64
65           These options are exactly the same as the options for the Listbox
66           widget. So for an explanation of these, take a look at
67           Curses::UI::Listbox.
68
69       ·   -onchange < CODEREF >
70
71           This sets the onChange event handler for the popupmenu widget.  If
72           a new item is selected, the code in CODEREF will be executed.  It
73           will get the widget reference as its argument.
74

METHODS

76       ·   new ( OPTIONS )
77
78       ·   layout ( )
79
80       ·   draw ( BOOLEAN )
81
82       ·   intellidraw ( )
83
84       ·   focus ( )
85
86       ·   onFocus ( CODEREF )
87
88       ·   onBlur ( CODEREF )
89
90           These are standard methods. See Curses::UI::Widget for an
91           explanation of these.
92
93       ·   get ( )
94
95           This method will return the currently selected value.
96
97       ·   onChange ( CODEREF )
98
99           This method can be used to set the -onchange event handler (see
100           above) after initialization of the popupmenu.
101

DEFAULT BINDINGS

103       There are bindings for the widget itself and bindings for the popup
104       listbox that can be opened by this widget.
105
106   The widget itself
107       ·   <tab>
108
109           Call the 'loose-focus' routine. This will have the widget loose its
110           focus.
111
112       ·   <enter>, <cursor-right, <l>, <space>
113
114           Call the 'open-popup' routine. This will show the popup listbox and
115           bring the focus to this listbox. See The popup listbox below for a
116           description of the bindings for this listbox.
117
118       ·   <cursor-down>, <j>
119
120           Call the 'select-next' routine. This will select the item in the
121           list that is after the currently selected item (unless the last
122           item is already selected). If no item is selected, the first item
123           in the list will get selected.
124
125       ·   <cursor-up>, <k>
126
127           Call the 'select-prev' routine. This will select the item in the
128           list that is before the currently selected item (unless the first
129           item is already selected). If no item is selected, the first item
130           in the list will get selected.
131
132   The popup listbox
133       The bindings for the popup listbox are the same as the bindings for the
134       Listbox widget. So take a look at Curses::UI::Listbox for a description
135       of these. The difference is that the 'loose-focus' and 'option-select'
136       routine will have the popup listbox to close. If the routine
137       'option-select' is called, the active item will get selected.
138

SEE ALSO

140       Curses::UI, Curses::UI::Listbox Curses::UI::Widget, Curses::UI::Common
141

AUTHOR

143       Copyright (c) 2001-2002 Maurice Makaay. All rights reserved.
144
145       Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de)
146
147       This package is free software and is provided "as is" without express
148       or implied warranty. It may be used, redistributed and/or modified
149       under the same terms as perl itself.
150
151
152
153perl v5.30.1                      2020-01-29          Curses::UI::Popupmenu(3)
Impressum