use Tk; use Tk::JComboBox; my $mw = MainWindow->new(); my $jcb = $mw->JComboBox( -relief => 'sunken', -mode => 'editable', -listbackground => 'white', -popuprelief => 'groove', -highlightthickness => 0, -choices => [qw/Black Blue Green Purple Red Yellow/] )->pack; $mw->Button( -text => 'func', -command => [ \&test, $jcb->getSelectedValue($jcb->getSelectedIndex()) ], # -command => [ \&test, 2 ], )->pack; $mw->Button( -text => 'embed', -command => [ sub { my ($p1); printf("e: \$p1 = >>$p1<<\n"); }, $jcb->getSelectedIndex() ] )->pack; MainLoop; sub test { my ($p1) = @_; printf("f: \$p1 = >$p1<\n"); }