Main Stack scripts

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Main Stack scripts

Post by phaworth »

I have a few message handlers in the main stack script of my application since they aply to every card in every stack in my application.

When I'm in browse mode, It seems that messages from the Revolution IDE are being passed to those handlers which seems a little weird to me. It doesn't cause any problems in my application because the handlers have code in them that happens to exclude the IDE messages but is this normal behaviour and if so, is there a way to disable that behavior?

Thanks,
Pete
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark »

Hi Pete,

Probably, this is normal, but because you don't tell us which messages you are dealing with, I can't really answer your question nor provide a good solution.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth »

The most troublesome one is the selectionChanged message.
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth »

Any further input on this?

I have a selectionChanged handler which ends up as a front script. Should only be executed when I'm in run mode, but it ends up being called when I'm in edit mode on a card and, not surprisingly fails most of the time.

Is there a property I can check to see if I'm in edit mode or run mode?

Thanks,
Pete
Regulae
Posts: 136
Joined: Tue Oct 20, 2009 6:05 am

Post by Regulae »

Dear Pete,

Possibly the "tool" function will be useful. When in browse mode, the tool returns "browse tool", in edit mode, "pointer tool", so you can ignore messages in edit mode with:
if the tool = "pointer tool" then
exit (handler name)
end if
Just a thought.
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth »

Sounds perfect, thanks!
Pete
Post Reply