[Melbourne-pm] TK repeats, scoping and keeping track of objects

Leigh Sharpe lsharpe at pacificwireless.com.au
Mon Jan 12 19:22:35 PST 2009


And herein lies the answers:

>I was using perl 5.8.8 and Tk 804.028 on the Mac and perl 5.10.0 and Tk
804.028 on Windows. 

v5.8.8 on Debian works exactly as I would expect. 5.6.1 on windows gives
me grief. Looks like it's time for an upgrade.

>but I suspect it's something to do with the answer Toby's just given.
:)
Yes, looks that way. I'll be looking at onDestroy() as well.


Thanks to all who chimed in. 

Leigh



-----Original Message-----
From: Matthew Robinson [mailto:matt at zensunni.org] 
Sent: Tuesday, 13 January 2009 1:52 PM
To: Leigh Sharpe
Cc: Jacinta Richardson; melbourne-pm at pm.org
Subject: Re: [Melbourne-pm] TK repeats, scoping and keeping track of
objects

Hi Leigh,

Leigh Sharpe wrote:
>
> Here's the bit I couldn't quite understand. My::Class::DESTROY() is 
> not called when the 'Exit' button on $tl is clicked. If I click on 
> 'Create an object' several times, and close any or all of the windows 
> it creates, there is no message printed when the window is closed. 
> Only when I click on 'Exit' in the main window, thereby terminating 
> the whole program, do I ever see DESTROY() called. And then it's once 
> for every object created while the program was running, irrespective 
> of whether it's window has been closed or not.  Try it, the above 
> example is complete.
>
>   
I have tried your example on both OSX and Windows and it is giving me
the required behaviour.  When I click the Exit button on the child
windows I get a message on the console saying 'fred is being destroyed'.
The message isn't always immediate but it does appear as a result of
clicking the Exit button on the $tl windows.

I was using perl 5.8.8 and Tk 804.028 on the Mac and perl 5.10.0 and Tk
804.028 on Windows.

HTH,

Matt


More information about the Melbourne-pm mailing list