sub PopupLookup{ my ($mw, $obj) = @_; print "Building popup\n"; my @items('black', 'yellow', 'red'); my $Content11='states'; my $Content12='city'; my $menu = $mw->Menu(-tearoff=>0, -menuitems=>[ [command=>'Show Menu', -command=>[sub {DialogSettings()}, $obj,]], [ checkbutton => "Show column 1", -variable => \$Content11, -onvalue => '11', -offvalue => '0', -compound => 'left', -command => [ sub { SetView(1) }, $obj ] ], [ checkbutton => "Show column 2", -variable => \$ContentC12, -onvalue => '12', -offvalue => '0', -compound => 'left', -command => [ sub { SetView(2) }, $obj ] ], map ( [radiobutton => " Search in $DBColumn{$_}", -variable => \$DBColumn, -command => sub {print "Setting $_\n"}, -value => $_, ], @items ), [ radiobutton => " Search all languages", -variable => \$DBColumnTo, -value => '0', -command => [ sub { print "Setting search in all\n" }, $obj ] ], ]); $obj->menu($menu); $obj->bind('', ['PostPopupMenu', Ev('X'), Ev('Y'), ]); return $obj; } #### sub menbut { my($TOP) = @_; my $menubutton = $TOP->Menubutton(qw/-underline 0 -relief raised/, -text => 'SELECT', -direction => 'above'); my $menu = $menubutton->menu(qw/-tearoff 0/); $menubutton->configure(-menu => $menu); $menubutton->command(-label => "menu: first item", -command => sub {print "You selected the first item from the $pos menu.\n"}); $menubutton->command(-label => "menu: second item", -command => sub {print "You selected the second item from the $pos menu.\n"}); $menubuttons->pack(); }