Prevent substack of messing up

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
Sjatplat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 75
Joined: Wed Jun 22, 2011 1:53 pm

Prevent substack of messing up

Post by Sjatplat » Wed Mar 26, 2014 10:22 pm

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

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Prevent substack of messing up

Post by dave.kilroy » Wed Mar 26, 2014 10:39 pm

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?
"...this is not the code you are looking for..."

Sjatplat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 75
Joined: Wed Jun 22, 2011 1:53 pm

Re: Prevent substack of messing up

Post by Sjatplat » Wed Mar 26, 2014 10:44 pm

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

Post Reply