how to delete a (sub)stack upon closing its window?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rozek
Posts: 151
Joined: Mon Jun 19, 2006 2:29 pm
Location: Böblingen, Germany
Contact:

how to delete a (sub)stack upon closing its window?

Post by rozek » Tue Dec 18, 2007 9:08 pm

Hello!

I'm currently trying to delete a (temporary) (sub)stack when its window is closed. Code like the following

local thisStack
put the long name of this stack into thisStack

create stack "TestStack"
set the MainStack of stack "TestStack" to thisStack
set the destroyStack of stack "TestStack" to true

does not have the desired effect: the stack remains in memory and can be inspected using the Application Browser.

How do I get rid of it?

Thanks in advance for any help!
Kind regards,

Andreas Rozek

rozek
Posts: 151
Joined: Mon Jun 19, 2006 2:29 pm
Location: Böblingen, Germany
Contact:

Post by rozek » Tue Dec 18, 2007 9:10 pm

Just as an additional remark

trying to

on closeStack
delete this stack
end closeStack

just produced an error message...
Kind regards,

Andreas Rozek

rozek
Posts: 151
Joined: Mon Jun 19, 2006 2:29 pm
Location: Böblingen, Germany
Contact:

Post by rozek » Tue Dec 18, 2007 9:12 pm

Another remark:

the cantDelete property of the stack is set to false
Kind regards,

Andreas Rozek

rozek
Posts: 151
Joined: Mon Jun 19, 2006 2:29 pm
Location: Böblingen, Germany
Contact:

Post by rozek » Tue Dec 18, 2007 9:36 pm

Strange...

for some reason (which I don't understand) the code shown above seems to work now...however, I now get a warning dialog which asks me to confirm the stack deletion.

How do I get rid of the confirmation dialog (in this special situation)?
Kind regards,

Andreas Rozek

Post Reply

Return to “Talking LiveCode”