Page 1 of 1
suppressing mouseEnter universally
Posted: Sat Aug 08, 2009 12:46 am
by Scott Richardson
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
Posted: Sat Aug 08, 2009 1:42 am
by Mark
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
Posted: Sat Aug 08, 2009 11:09 pm
by Scott Richardson
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