Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Tk question

by batkins (Chaplain)
on Nov 13, 2003 at 22:49 UTC ( #306959=note: print w/replies, xml ) Need Help??


in reply to Tk question

You need to call destroy on the target widget. When you create the button, do something like this:
$win->Button(-text => 'OK', -command => [\&ok, $win])->pack;
This will call ok($win) whenever the OK button is triggered (In general, \&ok is clearer than sub { ok() }). ok() then becomes:
sub ok { my $win = shift; $win->destroy; $notified = 1; }
Are you sure it was a book? Are you sure it wasn't.....nothing?

Replies are listed 'Best First'.
Re: Re: Tk question
by graff (Chancellor) on Nov 14, 2003 at 06:04 UTC
    I think the point being sought by the OP was to leave the "Tk::exit" out of this process -- apart from that, you've shown the way quite nicely.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://306959]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2022-12-10 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?