Cursing softly to myself

All flavors welcome.
Forum rules
Be kind.
Post Reply
User avatar
richmond62
Posts: 3047
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Cursing softly to myself

Post by richmond62 »

Custom cursor images must contain three colors: black, white, and a transparent color.
1. I wonder who thought black and white were colours?

2. Why are coloured cursors not allowed?

3, Can that be changed?

In MacOS one can change the cursors in several ways:
-
Screenshot 2024-05-08 at 16.16.12.png
Screenshot 2024-05-08 at 16.16.12.png (79.09 KiB) Viewed 487 times
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 3047
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Cursing softly to myself

Post by richmond62 »

This reminds me slightly of windowShape which uses a monochrome alpha channel to determine a stack's shape.
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1815
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Cursing softly to myself

Post by OpenXTalkPaul »

You can absolutely have color cursors, and now-days pretty large ones too.

I assume this comes from the Dictionary and just means that the color table of the bitmap must include these three items: 0,0,0 255,255,55 and some channel to indicate pixel transparency, but can include additional colors too... As seen in Tom's color cursor replacement Pointer and Animated hand-counting 'wait' cursor.

Cursors should also have a focal pixel set, which will be the loc point you get from mouseLoc(), for those left-handed cursors.
User avatar
richmond62
Posts: 3047
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Cursing softly to myself

Post by richmond62 »

Aha. Well I tried the

Code: Select all

set the cursor to XXXX
with this:
-
bigRed.png
bigRed.png (4.66 KiB) Viewed 481 times
-
Obviously I was expecting too much.
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1815
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Cursing softly to myself

Post by OpenXTalkPaul »

Proof it works (128 pixel cursors might not work on Windows)

Lock the cursor on mouseLeave, suspendStack, closeStack, etc. to have the cursor per-session persist whenever the mouseLoc is within one of OXT's windows, at least until something else explicitly changes the cursor again.
Warning, this demo is not for the easily offended:
ColorCursorDemo.oxtstack
(7.38 KiB) Downloaded 42 times
User avatar
richmond62
Posts: 3047
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Cursing softly to myself

Post by richmond62 »

Suitably offended. 8-)

Thanks for the help!

So: the Dictionary is wrong (again) . . . 8-)
-
HHGG.jpg
HHGG.jpg (13.04 KiB) Viewed 478 times
Attachments
BIG RED.oxtstack
(5.43 KiB) Downloaded 45 times
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1815
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Cursing softly to myself

Post by OpenXTalkPaul »

Glad to help.
There's also a note somewhere that if you remove the revCursor stack(s) from memory, or not-include them in a standalone, the Engine will then default to inheriting the operating system's cursors, but I've never tested that myself.

Now if that is the case, or if you wanted to get really tricky, the macOS' AppKit cursors are found in macOS here:
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HiServices.framework/Versions/A/Resources/cursors
I believe the preferred format used to be TIF, but in recent system versions they are in PDF files.
Screen Shot 2024-05-08 at 1.30.37 PM.png
Screen Shot 2024-05-08 at 1.30.37 PM.png (113.16 KiB) Viewed 474 times
User avatar
richmond62
Posts: 3047
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Cursing softly to myself

Post by richmond62 »

I don't want to fiddle around with the IED's cursors Ding An Sich, but I do need to sort out the funky cursors in my Devawriter Pro as they are now, not funky, as in Tom Wolfe, but funky as in cheesy feet.
-
Wolfe.jpg
Wolfe.jpg (10.83 KiB) Viewed 471 times
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 3047
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Cursing softly to myself

Post by richmond62 »

Screenshot 2024-05-08 at 22.04.23.png
Screenshot 2024-05-08 at 22.04.23.png (1.17 MiB) Viewed 470 times
-
Wow: that's a serious improvement. 8-)
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1815
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Cursing softly to myself

Post by OpenXTalkPaul »

I don't think it's as easy to fiddle with the system cursors as it once was, I think you have to turn off System Integrity Protections (SIP) if you want to mod the OS now days.

But there are something like 63 cursors in there for various use cases. While people probably should NOT copy Apple's Cursors into their own software's assets due to the potential licensing issues, if the cursor were to already be in .png format (as some of them are, in addition to the PDF), then you could copy them into your stack in order to temporarily use them and then discard that cursor data.

To truly use the system cursor in a more app-context-free system-wide way, you would need some Extension wi/FFI to call ObjC methods....
EDIT: Scratch that, NSCursor works based on what NSWindow/NSview objects are underneath the cursor so there's probably no way to change the system wide cursor other than changing those cursor PDF/PNG files inside that framework bundle.

For xTalk on the web (HyperSim or OXT Emscripten Engine), 'the cursor' is not functional, but you can use a little JavaScript to explicitly set a certain cursor to be used when the mouse is within specific elements (DOM objects) of in the current web page, which is similar to what Apple's AppKit does.

Also, I just found out that 'the clipboard' keyword was added to HyperTalk in HyperCard 2.3:
What's new in version 2.3?
-------------------------------------------------------

Support for PowerPC Macs including the ability to generate standalone
applications which are optimized for PowerPC Macs.

New Button Tasks which allow you to generate HyperTalk scripts without
scripting.

Enhancements to the Color Tools including a new color painting
environment.

Text-to-Speech capabilities. (only for Macintoshes with 68040 or
better microprocessors)

New HyperTalk: speak, the speech, stop speech, the voices, the
soundChannel, stop sound, the clipboard.

Enhancements to many current HyperTalk commands.
User avatar
richmond62
Posts: 3047
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Cursing softly to myself

Post by richmond62 »

https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1815
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Cursing softly to myself

Post by OpenXTalkPaul »

Its even better to 'set the defaultCursor' -- which is the cursor when no other cursor is set (slightly different behavior), you don't have to trap for mouseLeave or any of that.

Here's a pen tool cursor:
PenToolCursor.oxtstack
(28.25 KiB) Downloaded 40 times
User avatar
tperry2x
Posts: 1783
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Cursing softly to myself

Post by tperry2x »

As was mentioned here, on the other cursor demos which work. Might have been missed though as posts here have a habit of going off in all directions.

Edit, I've added one which sets the default cursor here.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests