in reply to Re^2: Writing my first PERL/Tk megawidgit
in thread Writing my first PERL/Tk megawidgit
I have the MEGAWIDGET displayed in my program. It is floating in the middle of a large text window -- called with 'DialogBox' and 'Show' . How do I get the data out of the Listbox (which is inside the MEGAWIDGET), so I can operate on it? This is my program-code -- as far as I have got:
my $header_msg = "Get what fr +om MemCache?" ; ******** BEGIN DialogBox ******** my $dialog = $top -> DialogBo +x ( + -title => ' ', + -buttons => [] + ); my $lb = $dialog -> ListBox3( + -text => $header_msg, ) + -> pack(-side => 'top' ); + $lb -> insert( 'end' , + @cache_list ); $dialog -> Button ( -t +ext => "Abort" , -b +g => 'red' , -c +ommand => sub { ( $dialog -> destroy() ) if Tk::Exists( $dialog ) ; } )-> +pack ( -side => 'bottom' , -fill => 'x' ); $lb -> bind ( '<Doubl +e-3>' , sub { + my $mychoice = $lb -> get( 'active'); + print "\$mychoice = : $mychoice\n\n "; + } ); ******** SHOW 'DialogBox ******** $top = $dialog -> Show +(); + # $lb -> bind('<Double- +3>' , \&get_choice); $lb -> bind ( '<Doubl +e-3>' , sub {
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Writing my first PERL/Tk megawidgit
by tybalt89 (Monsignor) on Jul 03, 2020 at 20:53 UTC | |
by tybalt89 (Monsignor) on Jul 04, 2020 at 13:33 UTC | |
by Anonymous Monk on Jul 04, 2020 at 22:50 UTC |
In Section
Seekers of Perl Wisdom