Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Code after MainLoop; Tk

by kcott (Archbishop)
on Jun 11, 2016 at 00:31 UTC ( [id://1165383]=note: print w/replies, xml ) Need Help??


in reply to Code after MainLoop; Tk

G'day PerlCowboy,

Welcome to the Monastery.

I've assumed you wrote "Reaped: Executing code after MainLoop; using Tk" before logging in. It's virtually identical to this post: both have the same problem and the same solution (already supplied by AnonymousMonk in "Re: Code after MainLoop; Tk"). I've requested that it be removed (which, on previewing, I see it has): you don't have to do anything else about this.

To expand upon AnonymousMonk's reply, you can find documentation

Here's your problem and solution in a nutshell:

#!/usr/bin/env perl use strict; use warnings; use Tk; my $mw = MainWindow->new; $mw->Button(-text => 'Problem: exit', -command => sub { exit } )->pack; $mw->Button(-text => 'Solution: destroy', -command => sub { $mw->destroy } )->pack; MainLoop; print "After MainLoop\n";

Test runs:

$ pm_1165366_tk_post_loop.pl # Test Problem $ pm_1165366_tk_post_loop.pl # Test Solution After MainLoop $

See also: Tk::callbacks.

— Ken

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-25 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found