preopenstack and closestack events

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kotikoti
Posts: 72
Joined: Tue Apr 15, 2008 7:35 pm

preopenstack and closestack events

Post by kotikoti » Wed Nov 26, 2008 6:08 am

Hi all,
Please advice on when the above can be used.

I have a stack build with several substacks within. I am calling one of the substacks as a modal item as follows

Code: Select all

modal stack "systemSettings" --substack
What I end up getting is the code in the main stack executing the preopenstacks function (not desired) since this sub window only meant to display some data... and when I close it, it also executes the closestack function, thus destroying some variables I have in the system

Is my call to modal stack "systemSettings" at fault or am I missing something?

Cheers
Build 160
Version 2.9.0
Platform: Windows

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Wed Nov 26, 2008 7:31 am

This is a message path issue. Stack messages that are unhandled will be passed on trough the message path. as the mainstack comes after the substack in the message path, it will get an all stack messages originating from the substack.

The easiest workaround is to put the mainstack handlers into the first card of the mainstack. Openstack etc. all will be sent to the first card of a stack, so they'll trigger when the mainstack opens. The cards of the mainstack are not in the message path for substacks so they're "save" there.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

kotikoti
Posts: 72
Joined: Tue Apr 15, 2008 7:35 pm

Post by kotikoti » Wed Nov 26, 2008 7:36 am

Hi BvG
Thanks for the quick pointer... Late in the night, and forgot the message path rules,
Koti2
Build 160
Version 2.9.0
Platform: Windows

Post Reply