The CURSOR curse

Klaus Major kmajor at metascape.org
Wed Jun 26 06:11:01 CDT 2002


Hi Mathewson,

> I thought I would be clever, so I dragged out Danny
> Goodman's HC book from under the bed: and; blow-me-down if
> the way to change cursors in HC is not 100% the same in
> RunRev (a BIG, BIG thank you to Run Rev for being
> conservative): just the same in the Transcript Dictionary
> with RunRev.  Of course I got all damp and excited - I was
> going to go completely OTT and change cursors like nobody's
> business when......
>
> I made a trial stack with a bloody great button in the
> middle and typed in the following script to the button:
>
> on mouseWithin
>   set cursor to arrow
> end mouseWithin
>
> then went into browser mode and it didnae wark!
>
> spent hours mucking around to no avail; so the big question
> is:
>
> WHAT AM I MISSING ???
>
> Mathewson

if you want the cursor to be persistent after the script is finished,
you have to  set the lockcursor to true.

The above is the "normal" behaviour.

The cursor is reset after the script is finished.

on mouseWithin
    set the lockcursor to true
   set cursor to arrow
end mouseWithin

I would advice to script a mouseenter-handler:

on mouseenter
    set the lockcursor to true
   set cursor to arrow
end mouseenter

And don't forget to set the cursor back on mouseleave...
Or the cursor will stay forever (or until you set it again) even in the
development-environment, which is really annoying...

on mouseleave
   set the lockcursor to false
   set the cursor to hand ## or whatever
end mouseleave

Hope that helps.


Regards


Klaus Major
kmajor at metascape.org




More information about the use-livecode mailing list