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 » Wed Oct 14, 2009 11:43 pm

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 » Thu Oct 15, 2009 12:33 am

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 » Thu Oct 15, 2009 12:39 am

The most troublesome one is the selectionChanged message.

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

Post by phaworth » Fri Oct 30, 2009 1:55 am

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 » Fri Oct 30, 2009 3:59 am

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 » Fri Oct 30, 2009 4:19 am

Sounds perfect, thanks!
Pete

Post Reply