FourthWorld wrote: ↑Thu May 02, 2024 3:54 pm
Using the defaultCursor global property instead of lockCursor may provide a better UX for many types of apps, as it allows the cursor to change automatically to the I-beam when in text.
Setting defaultCursor has an effect of replacing the Run/'Browse' cursor in memory, the custom cursor can then change when mouse is over text as the Engine needs it to but then goes back to the cursor you've set when the mouse leaves that text area.
tperry2x wrote: ↑Thu May 02, 2024 1:39 pm
Seems to work here, (
resulting test video), but:
Rather than using 'Set the cursor to empty' - which (at least to my mind) would make the cursor blank, it might be better to use:
I'm not sure why the LCC one works, and the the OXT one didn't for you (although it did for me in OXT) - however, according to the dictionary:
set the cursor to none: Hides the cursor
(so if 'empty' is also regarded as 'none', then this makes sense).
The dictionary also says you can use:
* none: Hides the cursor
* busy: Use repeatedly during a long handler
* watch: Use during a moderately long handler
* arrow: Use for select|selecting objects
* cross: Use for painting, drawing, or select|selecting a point or small area
* hand: Use for clicking hypertext links
* iBeam: Use for select|selecting text in a field
* plus: Use for select|selecting items such as spreadsheet cells
* help: Use for getting online help
It also says further down:
You can also set the cursor property to the ID of an image
Which is where my:
suggestion comes from.
In that demo video, you'll also see an issue with using the mouseEnter and mouseLeave handlers to control cursors.
When the cursor passes over 'another object' inside the square, it counts as a mouseleave and sets the cursor back incorrectly. You could perhaps consider checking if the cursor is within a given rect instead.
There's no need for different threads about the same 'cursors' topic, I wish these discussions could organize themselves, but I guess it's all interconnected to some degree. I try to use search to find the topics. But I know my stream of consciousness dumping jumps around a lot, one topic will often inspire thoughts about some loosely related topic. That's not necessarily a bad thing.
Anyway, I think Richmond had his cursor locking coming before his setting the cursor, which is the opposite of what you'd want. You set the cursor and THEN lock it so that it doesn't change back to the defaultCursor when the handler exits.
Hiding the cursor (set to 0, or empty, or 'none' which is a constant with numeric value of 0) doesn't really work well when I just tested those, the cursor hides but reappears flickering back and forth between hidden and visible as the mouse is moved. I think I remember it working properly to hide cursor (sans-flicker) in the past but maybe I'm wrong. I haven't attempted a 'kiosk' or presentation/slideshow sort of thing in a long time.
...
Stream of consciousness dump:
I wonder if we can't add more to the base set of cursors that are available to with additional global constants,
which is what the cursor names are. The 'busy' constant contains a list of number 16 to 23 then I guess?
The fact that the keywords are actually numeric constants really tripped me up when I had a Widget posting virtual keyDown/Up messages back to the engine from my Alpha-Numeric OnScreenKeyboard widget, because it was somehow being evaluated as number when the widget would 'post 'keyDown" && "plus", the receiving handler in the widget script was recieving 'keyDown 13' (FYI 'post' is a bit like the Widget/Extension Builder keyword equivalent of 'send').
One additional cursor I'd like to have available a 'pentool' cursor that looks like the common vector drawing sort of cursor, not a pencil or a brush. Because currently the graphics tools all use the same cross cursor. I also want there to be two separate select cursors for when 'select grouped' is on or off. And also want some sort of cursor to indicate cloning/copying of some object (The Arrow with a Plus sign inside circle).
revCursors (or revMacCursors, or whatever) actually has cursors 1 - 40, including each frame of 'busy', and only 9 of them are named with a keyword. Really we can have an unlimited amount of cursors.
Code: Select all
on mouseDown pButtonNumber
repeat with x = 1 to 40
set the cursor to x
lock cursor
wait 0.5 second
unlock cursor
end repeat
end mouseDown
Didn't 'wait' (the clock or hourglass cursor) also used to be an animated cursor like 'busy'? And the counting hand was one in HyperCard too. I think they all came as 'CURS' resources in HyperCard (or from the Macintosh Toolbox ROM).
Modern MacOS AppKit comes with 59 cursors (which does NOT including animated cursor frames).
Web browsers standardized on these cursor names:
[ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | grab | grabbing | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out ]
Could use cursors assets from Linux World, Gimp, InkScape.