Page 1 of 1

Prevent substack of messing up

Posted: Wed Mar 26, 2014 10:22 pm
by Sjatplat
Whenever I create a substack and want to edit it - my main stack keeps getting input from the mouse. To prevent this I have to script everything so it refers to the mainstack - like this:

put cMyarray[wordlist] into field "wordlist" of card "Wordlist" of stack "Mainstack"

the scripts gets very "wordy" and if I change the name of the card or the stack - I guess i shouldnt do this but...then - its a mess.

My substacks are modal when called for in the script of the mainstack - but when I want to edit them they are not....

Is there a good habit here? some simple code magic? :D

Sjat

Re: Prevent substack of messing up

Posted: Wed Mar 26, 2014 10:39 pm
by dave.kilroy
Hi Sjat

Check out these 'message path" links http://lessons.runrev.com/s/3527/m/4603 ... ssage-path and http://www.fourthworld.com/embassy/arti ... _path.html

Does the 'mouse input' from your substacks appear in a mouseUp handler in the mainstack? Assuming this or something similar is the case then what you need to do is to trap the mouseUp message (or similar message) whilst still in the substack to prevent it travelling up the message path to your mainstack.

Even if you have a blank handler in your substack it will be enough to trap the message:

Code: Select all

on mouseUp
end mouseUp
Does this help or have I misunderstood what you are after?

Re: Prevent substack of messing up

Posted: Wed Mar 26, 2014 10:44 pm
by Sjatplat
AAAHHH! Yes. That is exactly what I´m after. I forget the message path hierarchy all the time. THANKS!

EDIT: And beware of your resizestack handler..

these empty handlers in the substack of my mainstack will make livecode freeze ....just a little less...

Code: Select all

on resizestack
end resizestack

on mouseup
end mouseup

on mousedown
end mousedown

on mousemove
end mousemove

on mouseenter
end mouseenter

on mouseleave
end mouseleave