richmond62 wrote: ↑Thu Aug 22, 2024 4:56 pm
on mouseEnter
set the lockCursor to true
set the cursor to (the ID of image "SR" of card "DEPOSITORY")
end mouseEnter
on mouseLeave
set the lockCursor to false
set the cursor to arrow
end mouseLeave
on leaving the field I end up with a
hand cursor.
I know 'the cursor' syntax may not be very intuitive, but you have to
set the cursor first, and
THEN lock the cursor. While the cursor is locked, you cannot change it. So just swap the order of those lines and it should work.
Code: Select all
on mouseEnter
set the cursor to (the ID of image "SR" of card "DEPOSITORY")
set the lockCursor to true
end mouseEnter
on mouseLeave
set the lockCursor to false -- unlock to allow changing the cursor
set the cursor to arrow -- change the cursor
set the lockCursor to true -- lock again to disallow changing the cursor (but only while cursor is within a stack window)
end mouseLeave
You may also want to have handlers for 'on exitFeild','closeField','dragLeave' (if allowDrop is on), 'on focusOut','on mouseWithin' (only sent when in user 'Browse' Mode), 'on tabKey' (if you use tab to exit a field), and of course your scripts can check 'the mouseControl' at any time. You might also check on mouseRelease. You could also add the checking to the card or to a group that the fld is in.
Certain objects may automatically force the cursor to change temporarily, like unlocked text fields may change to the I-beam automatically when you mouse over them.
Remember, you can additionally set 'the defaultCursor', which is slightly different then setting 'the cursor'.