in reply to GUI issue
Here is a simple example. For further help, make a small fully running code snippet for us to play with. Having to flesh out incomplete code examples, for testing, usually results in monks moving on to the next question.
#!/usr/bin/perl use Tk; my $mw = MainWindow->new; my $rb = 'first button'; my $rb1 = $mw->Radiobutton(-text => "Button One", -value => 'button1', -variable => \$rb, -command => [ \&showRB, \$rb, 1, 'man' ])- +>pack; my $rb2 = $mw->Radiobutton(-text => "Button Two", -value => 'button2', -variable => \$rb, -command => [ \&showRB, \$rb, 2, 'auto' ])->pack; MainLoop; sub showRB { #print "Arg list is @_\n"; #print "@_\n"; my ($state_ref, $button_num, $type) = @_; my $state = $$state_ref; print "$state $button_num $type\n"; $mw->messageBox(-title => 'Status', -type => 'OK', -message => "Status is :$state: $type button $bu +tton_num."); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: GUI issue
by harika123 (Initiate) on Oct 19, 2011 at 11:20 UTC |