Curses-UI-POE

 view release on metacpan or  search on metacpan

examples/demo-widgets  view on Meta::CPAN


# ----------------------------------------------------------------------
# Popupmenu
# ----------------------------------------------------------------------

$w{6}->add(
    undef, 'Label',
    -text => "The popmenu is much like a standard listbox. The difference is\n"
           . "that only the currently selected value is visible (or ---- if\n"
	   . "no value is yet selected). The list of possible values will be\n"
	   . "shown as a separate popup windows if requested.\n"
	   . "Press <ENTER> or <CURSOR-RIGHT> to open the popupbox and use\n"
	   . "those same keys to select a value (or use <CURSOR-LEFT> to close\n"
	   . "the popup listbox without selecting a value from it). Press\n"
	   . "</> in the popup for a 'less'-like search through the list."
);

$w{6}->add(
    undef, 'Popupmenu',
    -y          => 9,
    -values     => $values,
    -labels     => $labels,
    -width      => 20,
    -onchange   => sub {
        my $pm = shift;
	my $lbl = $pm->parent->getobj('popupmenulabel');
	my $val = $pm->get;
	$val = "<undef>" unless defined $val;
	my $lab = $pm->{-labels}->{$val};
	$val .= " (label = '$lab')" if defined $lab;
	$lbl->text($val);
	$lbl->draw;
    },
);

$w{6}->add(
    undef, 'Label', -y => 9, -x => 21,
    -text       => "--- selected --->"
);

$w{6}->add(
    'popupmenulabel', 'Label',
    -y => 9, -x => 39, -width => -1,
    -bold => 1,
    -text       => "none"
);

# ----------------------------------------------------------------------
# Progressbar
# ----------------------------------------------------------------------

$w{7}->add( 



( run in 2.472 seconds using v1.01-cache-2.11-cpan-364913b4093 )