Re: Best Practice: Prevent Substacks from Triggering Main Stack Scripts

2015-02-08 Thread Dr. Hawkins
On Fri, Feb 6, 2015 at 12:33 PM, J. Landman Gay jac...@hyperactivesw.com
wrote:

 If almost everything needs to use the open* handlers except one or two
 stacks, then I put the handlers into the mainstack stack script and put
 blocking handlers into the stacks that are an exception.


This.

I quickly figured out that it as easier to trap in my mainstack handler
than to worry about putting it in every new substack . .


-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Best Practice: Prevent Substacks from Triggering Main Stack Scripts

2015-02-06 Thread Bob Sneidar
Put the handlers in the card script of the main stack. When opening the 
mainStack the card will receive the messages, but not when the substacks are 
opened. The card of the mainStack is not in the message path of the substacks. 

Alternately, you can put the same handlers in the substacks stack script and 
not pass them. 

Bob S


 On Feb 5, 2015, at 22:49 , Brahmanathaswami bra...@hindu.org wrote:
 
 If you put any preopenstack, resizestack, close stack etc. script in the 
 mainstack script.. these will be triggered by the same action in a substack.
 
 What is the best way to avoid this?
 
 I just moved all those to the main background group of the main stack, but 
 I'm not happy with that architecture. I'm so
 use to running most script in the main stack script for simplicity sake and 
 ease of finding things.
 
 I suppose one can install dummy handlers in the substacks to match.
 
 e.g
 on preopenstack
 end preopenstack
 
 and since you are not passing anything, I suspect it will prevent triggering 
 that handler in the main stack..
 
 But, what are you veterans doing to handle this?
 
 Swasti Astu, Be Well!
 Brahmanathaswami
 
 Kauai's Hindu Monastery
 www.HimalayanAcademy.com
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Best Practice: Prevent Substacks from Triggering Main Stack Scripts

2015-02-06 Thread Bob Sneidar
There are some advantages to using substacks methinks. The monistic 
automatically “knows” about the substacks without any extra coding or adding 
the stacks to the main stack files property. Also, I am not sure that graphics 
loaded in the main stack will be accessible to any stacks that are not 
substacks of the same. Thirdly, if you don’t want anyone to open the substack 
without first opening the main stack, a simple “if the mainStack of me is me 
then get the hell out” sort of command in the openStack script is all you need. 
There are probably some others. Not sure but if you password protect the main 
stack, aren’t the substacks inaccessible as well? Finally, I think it looks 
good organizationally. Just my humble opinion tho’.

Bob S


On Feb 6, 2015, at 01:12 , Mark Schonewille 
m.schonewi...@economy-x-talk.commailto:m.schonewi...@economy-x-talk.com 
wrote:

Hi Brahmanathaswami,

It isn't obligatory to use substacks. You could use two mainstacks 
simultaneously. Just make sure to include the additional mainstacks as files 
when you build a standalone.

With two mainstacks, the scripts in one stack won't be triggered by messages 
from the other. If you have handlers that you want to use in both stacks, you 
can put those handlers into another separate stack and use that as a library 
with the start using command or by defining front and back scripts.

--
Best regards,

Mark Schonewille

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Best Practice: Prevent Substacks from Triggering Main Stack Scripts

2015-02-06 Thread J. Landman Gay

On 2/6/2015 1:38 PM, Bob Sneidar wrote:

Not sure but if you password protect the main stack, aren’t the
substacks inaccessible as well?


Nope. You have to protect each one separately.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Best Practice: Prevent Substacks from Triggering Main Stack Scripts

2015-02-06 Thread J. Landman Gay

On 2/6/2015 12:49 AM, Brahmanathaswami wrote:

If you put any preopenstack, resizestack, close stack etc. script in the
mainstack script.. these will be triggered by the same action in a
substack.

What is the best way to avoid this?


I usually do the thing where you put the open* handlers into the first 
card of the mainstack. It's easiest.


If there are handlers that should be shared, but only with a few stacks, 
I put those handlers into the mainstack and check in the first line of 
the handler to see if the target is one of the stacks it needs to work 
with, and if not it exits.


If almost everything needs to use the open* handlers except one or two 
stacks, then I put the handlers into the mainstack stack script and put 
blocking handlers into the stacks that are an exception.


So I guess the answer is...it depends.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Best Practice: Prevent Substacks from Triggering Main Stack Scripts

2015-02-06 Thread Brahmanathaswami

it depends

got it... for me it's not about protecting anything..

it's about..eg.

on resizestack x,y

  set the rect of some grc to the rect of this card
# and other tricks here  relating to dynamic geometry changes...

end resize stack

This gets triggered by a substack that does not have those controlled.

How do you do this in real code

on resizestack x,y
 if this stack is not the stack that this handler resides in then
   do nothing
else
  set the rect of some grc to the rect of this card
# and other tricks here  relating to dynamic geometry changes...

  end if

end resizestack



Swasti Astu, Be Well!
Brahmanathaswami

Kauai's Hindu Monastery
www.HimalayanAcademy.com



J. Landman Gay wrote:


I usually do the thing where you put the open* handlers into the first 
card of the mainstack. It's easiest.


If there are handlers that should be shared, but only with a few 
stacks, I put those handlers into the mainstack and check in the first 
line of the handler to see if the target is one of the stacks it needs 
to work with, and if not it exits.


If almost everything needs to use the open* handlers except one or two 
stacks, then I put the handlers into the mainstack stack script and 
put blocking handlers into the stacks that are an exception.


So I guess the answer is...it depends. 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Best Practice: Prevent Substacks from Triggering Main Stack Scripts

2015-02-06 Thread Richard Gaskin

Brahmanathaswami wrote:


it depends

got it... for me it's not about protecting anything..

it's about..eg.

on resizestack x,y
   set the rect of some grc to the rect of this card
# and other tricks here  relating to dynamic geometry changes...
end resize stack

This gets triggered by a substack that does not have those controlled.

How do you do this in real code

on resizestack x,y
  if this stack is not the stack that this handler resides in then
do nothing
else
   set the rect of some grc to the rect of this card
# and other tricks here  relating to dynamic geometry changes...
   end if
end resizestack


If the mainstack is a single card, just put the handler in the card script.

If the mainstack has multiple cards, put the handler in a common group 
script.


If neither of those are viable in your setup, you could add a check to 
make sure the long name of me is in the long ID of the target.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Best Practice: Prevent Substacks from Triggering Main Stack Scripts

2015-02-06 Thread Brahmanathaswami



Richard Gaskin wrote:

1) If the mainstack is a single card, just put the handler in the card 
script.


2) If the mainstack has multiple cards, put the handler in a common 
group script.


3) If neither of those are viable in your setup, you could add a check 
to make sure the long name of me is in the long ID of the target.



BR:  Understood. I doing # 2 now... so I guess that will do for now.




How do you do this in real code

on resizestack x,y
  if this stack is not the stack that this handler resides in then
do nothing
else
   set the rect of some grc to the rect of this card
# and other tricks here  relating to dynamic geometry changes...
   end if
end resizestack





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Best Practice: Prevent Substacks from Triggering Main Stack Scripts

2015-02-06 Thread Mark Schonewille

Hi Brahmanathaswami,

It isn't obligatory to use substacks. You could use two mainstacks 
simultaneously. Just make sure to include the additional mainstacks as 
files when you build a standalone.


With two mainstacks, the scripts in one stack won't be triggered by 
messages from the other. If you have handlers that you want to use in 
both stacks, you can put those handlers into another separate stack and 
use that as a library with the start using command or by defining front 
and back scripts.


--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Installer Maker for LiveCode:
http://qery.us/468

Buy my new book Programming LiveCode for the Real Beginner 
http://qery.us/3fi


LiveCode on Facebook:
https://www.facebook.com/groups/runrev/

On 2/6/2015 07:49, Brahmanathaswami wrote:

If you put any preopenstack, resizestack, close stack etc. script in the
mainstack script.. these will be triggered by the same action in a
substack.

What is the best way to avoid this?

I just moved all those to the main background group of the main stack,
but I'm not happy with that architecture. I'm so
use to running most script in the main stack script for simplicity sake
and ease of finding things.

I suppose one can install dummy handlers in the substacks to match.

e.g
on preopenstack
end preopenstack

and since you are not passing anything, I suspect it will prevent
triggering that handler in the main stack..

But, what are you veterans doing to handle this?

Swasti Astu, Be Well!
Brahmanathaswami

Kauai's Hindu Monastery
www.HimalayanAcademy.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Best Practice: Prevent Substacks from Triggering Main Stack Scripts

2015-02-05 Thread Scott Rossi
If you can do it, the easiest way is to place all your handlers in the card 
script of the first card of your main stack.  All the handlers will be 
triggered by the main stack, but not the substacks.

If you must place your handlers in the stack script, you can compare the name 
of the owner of the target at the beginning of each handler, something like:
if the short name of the owner of the target  the short name of me then exit 
resizeStack

Otherwise, your method of placing blocking scripts in the substacks will work 
too, but the card script of card 1 of the main stack is really the easiest 
method.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design

 On Feb 5, 2015, at 10:49 PM, Brahmanathaswami bra...@hindu.org wrote:
 
 If you put any preopenstack, resizestack, close stack etc. script in the 
 mainstack script.. these will be triggered by the same action in a substack.
 
 What is the best way to avoid this?
 
 I just moved all those to the main background group of the main stack, but 
 I'm not happy with that architecture. I'm so
 use to running most script in the main stack script for simplicity sake and 
 ease of finding things.
 
 I suppose one can install dummy handlers in the substacks to match.
 
 e.g
 on preopenstack
 end preopenstack
 
 and since you are not passing anything, I suspect it will prevent triggering 
 that handler in the main stack..
 
 But, what are you veterans doing to handle this?
 
 Swasti Astu, Be Well!
 Brahmanathaswami
 
 Kauai's Hindu Monastery
 www.HimalayanAcademy.com
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Best Practice: Prevent Substacks from Triggering Main Stack Scripts

2015-02-05 Thread Brahmanathaswami
If you put any preopenstack, resizestack, close stack etc. script in the 
mainstack script.. these will be triggered by the same action in a substack.


What is the best way to avoid this?

I just moved all those to the main background group of the main stack, 
but I'm not happy with that architecture. I'm so
use to running most script in the main stack script for simplicity sake 
and ease of finding things.


I suppose one can install dummy handlers in the substacks to match.

e.g
on preopenstack
end preopenstack

and since you are not passing anything, I suspect it will prevent 
triggering that handler in the main stack..


But, what are you veterans doing to handle this?

Swasti Astu, Be Well!
Brahmanathaswami

Kauai's Hindu Monastery
www.HimalayanAcademy.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode