Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Tcl::Tk exit

by chrstphrchvz (Scribe)
on May 09, 2019 at 22:14 UTC ( #1233542=note: print w/replies, xml ) Need Help??


in reply to Tcl::Tk exit

I rediscovered this issue in Tcl::pTk; see RT #128654.

The simple explanation is that Perl/Tk redefines exit (see Mastering Perl/Tk 1.4.1 "exit Versus destroy"), while Tcl::Tk and Tcl::pTk do not. I do not know the details of why using exit in Tcl::(p)Tk causes errors; maybe Perl/Tk's exit implementation offers more insight.

The working alternative is to use destroy, and as tybalt89's answer points out, it allows code appearing after MainLoop and any other cleanup code to run, unlike exit.

Even though -command => \&exit and -command => sub { exit } are documented and common idioms in Perl/Tk, I would not be surprised if Tcl::Tk chooses to not support these, given the available alternative; and even if supporting these is desirable for Tcl::pTk, I'm not sure whether that can or will ever get implemented. I suggest following the RT ticket in case of any updates.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2022-09-25 17:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (116 votes). Check out past polls.

    Notices?