suppressing mouseEnter universally

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
Scott Richardson
Posts: 34
Joined: Mon May 08, 2006 7:02 pm

suppressing mouseEnter universally

Post by Scott Richardson » Sat Aug 08, 2009 12:46 am

I have stacks I am building for education that will be used for both study and teaching. When used for study, each card has many areas that use mouseEnter/mouseLeave for study tips and additional info. What I need to do is to have a universal way (setting a preference, maybe?) to toggle off (or suppress) all mouseEnter/mouseLeave instances for every card in the stack for the stack to be used in "teaching mode." Is there a practical way to accomplish this? Is there another way I should approach this other than using mouseEnter/mouseLeave in the first place? I suppose I could just use two stacks, but I would prefer to use the same stack.

Thanks,
Scott

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

Post by Mark » Sat Aug 08, 2009 1:42 am

Hi Scott,

You'll need to experiment with this to see whether it is practical, but you might creater a button with the following script:

Code: Select all

global gStudyMode

on mouseEnter
  if gStudyMode is true then pass mouseEnter
end mouseEnter

on mouseLeave
  if gStudyMode is true then pass mouseLeave
end mouseLeave
and use the following syntax, e.g. in a preOpenStack handler, to activate the script:

Code: Select all

insert script of button "Your Button" into front
This will affect all mouseEnter messages, even those that you might need. So, be careful, save your work before testing.

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

Scott Richardson
Posts: 34
Joined: Mon May 08, 2006 7:02 pm

Post by Scott Richardson » Sat Aug 08, 2009 11:09 pm

I have tried the suggested script format, but I must not be doing something right. I want to use a check box to toggle the mouseEnters on/off, but when I use the script, it lets me turn them off, but then they won't turn back on.

Also, I have just tried using the preOpenStack approach, but does this require the stack to be closed/reopened for the changes to take place? This may be related to the above problem, although it didn't matter if I reopened the stack or not. Even when I removed it from the stack script, it would still keep the mouseEnters disabled until I manually removed it from the frontScripts section of the message box.

There is a lot I don't know about this stuff. None of my previous stacks needed this kind of control and so I am not very familiar with this whole global idea. I think I am just confusing myself.

Too, I have decided that it might be better to have this feature on a card by card basis instead of stack-wide. Would the approach be different for this or would I simply use the card script instead of the stack script? I appreciate any more help.

Thanks again,
Scott

Post Reply