Security Advisories (3)
CVE-2007-4769 (2008-01-09)

The regular expression parser in TCL before 8.4.17, as used in PostgreSQL 8.2 before 8.2.6, 8.1 before 8.1.11, 8.0 before 8.0.15, and 7.4 before 7.4.19, allows remote authenticated users to cause a denial of service (backend crash) via an out-of-bounds backref number.

CVE-2018-25032 (2022-03-25)

zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if the input has many distant matches.

CVE-2011-3045 (2012-03-22)

Integer signedness error in the png_inflate function in pngrutil.c in libpng before 1.4.10beta01, as used in Google Chrome before 17.0.963.83 and other products, allows remote attackers to cause a denial of service (application crash) or possibly execute arbitrary code via a crafted PNG file, a different vulnerability than CVE-2011-3026.

NAME

Tk::Optionmenu - Let the user select one of some predefined options values

SYNOPSIS

    use Tk::Optionmenu;

    $opt = $w->Optionmenu(
			-options => REFERENCE_to_OPTIONLIST,
			-command => CALLBACK,
			-variable => SCALAR_REF,
			);

    $opt->addOptions( OPTIONLIST );

    # OPTION LIST is
    #   a)  $val1, $val2, $val3,...
    #   b)  [ $lab1=>$val1], [$lab2=>val2], ... ]
    #   c)  combination of a) and b), e.g.,
    #       val1, [$lab2=>val2], val3, val4, [...], ...

DESCRIPTION

The Optionmenu widget allows the user chose between a given set of options.

If the user should be able to change the available option have a look at Tk::BrowseEntry.

OPTIONS

-options

(Re)sets the list of options presented.

-command

Defines the callback that is invokes when a new option is selected.

-variable

Reference to a scalar that contains the current value of the selected option.

-textvariable

Reference to a scalar that contains the text label of the current value of the selected option.

METHODS

addOptions

Adds OPTION_LIST to the already available options.

EXAMPLE

use Tk;
my $mw = MainWindow->new();

my ($var, $tvar);
my $opt = $mw->Optionmenu(
       -options => [[jan=>1], [feb=>2], [mar=>3], [apr=>4]],
       -command => sub { print "got: ", shift, "\n" },
       -variable => \$var,
       -textvariable => \$tvar
      )->pack;

$opt->addOptions([may=>5],[jun=>6],[jul=>7],[aug=>8]);

my $f = $mw->Frame(-relief=>'groove', -borderwidth => 2)->pack;
$f->Label(-textvariable=>\$tvar)->pack(-side => 'left');
$f->Label(-text => " -> ")->pack(-side => 'left');
$f->Label(-textvariable=>\$var)->pack(-side => 'left');

$mw->Button(-text=>'Exit', -command=>sub{$mw->destroy})->pack;

MainLoop;

SEE ALSO

Tk::Menubutton, Tk::BrowseEntry