Peter M. Brigham, MD
pmbrig at gmail.com
Fri Aug 12 08:39:48 EDT 2011
I much prefer never to lock the cursor -- it tends to stay locked at odd moments. Instead try setting "the defaultcursor."
The problem of your cursor changes not happening as expected probably comes down to where the script is -- it may not be in the message path for some reason, maybe you are trapping mousemove in some individual controls, etc. One approach is to use a frontscript:
Put these in the script of card 1 of your standalone main stack
insert the script of btn "myFrontScript" of stack "someStack" into front
If you're working in the IDE, you might want to put this in the same place, so the frontscript down't persist when you move on to other projects:
remove the script of btn "myFrontScript" of stack "someStack" from front
Script of btn "myFrontScript":
if "button" is word 1 of the target then
set the defaultcursor to hand
set the defaultcursor to empty
pass mousemove -- important!
Peter M. Brigham
pmbrig at gmail.com
On Aug 12, 2011, at 2:37 AM, FlexibleLearning wrote:
> Looks like 2 issues here. First getting the cursor to stick; second getting
> the correct cursor display.
> Lock/Unlock cursor should resolve the first; importing and using your own
> cursor image should resolve the second.
> local cHand=999100
> local cArrow=999101
> on mouseEnter
> if "button" is word 1 of the target then
> set the cursor to cHand
> else set the cursor to cArrow
> lock cursor
> end mouseEnter
> on mouseLeave
> unlock cursor
> pass mouseLeave
> end mouseLeave
> Hugh Senior
> Chip Thomas wrote:
> Having some trouble changing the cursor, and hope someone can help shed some
> light on the topic.
> I have a "mouseEnter" script on the main card that checks if the target is a
> "button". If it's a button, it sets the cursor to hand. If not, it sets it
> to arrow.
> I've tried implementing this in two different projects.
> One project is a launcher system where the standalone just launches a
> separate main stack file. The cursor script is on the card of this stack
> file. In this project, I don't get any cursor changes except when in the
> development environment.
> The second project is just a regular standalone with the cursor script on
> the main card of the standalone. I do get a cursor change, but I get a
> watch rather than a hand.
> Argh! Any help would be much appreciated.
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode