Small gotchas for standalones (app icon, cursors)

If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.

Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.

Moderator: Klaus

Post Reply
stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Small gotchas for standalones (app icon, cursors)

Post by stam » Sun May 07, 2023 4:02 am

Hi all,
I'm considering submitting an enhancement request for some silly issues that affect standalones.

I just spent an annoying hour trying to figure out why when wanting to change the cursor to a hand it showed up as a watch on MacOS standalone and was completely missing on Win 10 standalone, and why the app icon, which is designated standalone settings, was missing from answer/ask dialogs on both platforms.

For anyone else being troubled with these relatively minor issues:
1. For the app icon to show in dialogs you have to in dialogs you have to actually import the image to the stack and make a note of its ID. Then in the on startup handler of the stack:

Code: Select all

on startUp
   global gRevAppIcon
   put <the image id> into gRevAppIcon
end startUp
2. for the default cursors to work you actually have to manually include the 'cursors' external... I mean really!



In my view: if we've gone to the effort of creating app icons for each platform already, why should we also have to import the icon. Surely it should be possible for LC to use the designated app icon?

For cursors: should the 'cursors' external not be loaded by default, the same way as the ask/answer dialogs are? Yet one more nuisance detail to remember to do when building standalones...

If others agree will submit enhancement requests (arguably bug reports) for these minor but annoying issues...

Many thanks
Stam

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Small gotchas for standalones (app icon, cursors)

Post by jacque » Sun May 07, 2023 6:06 pm

The ask and answer dialogs require images of different sizes than the app icon, so that's probably the reason. On recent versions of Android the app icon isn't in a plain image format any more, so there's that. I suppose LC could extract the images and resize them for us though.

The cursor stack includes everything in the tools palette and other things as well so I think few people would need that. The OS pointer cursor is always available so unless you need all the others it's logical to allow the developer to choose.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Small gotchas for standalones (app icon, cursors)

Post by stam » Mon May 08, 2023 2:29 am

jacque wrote:
Sun May 07, 2023 6:06 pm
The ask and answer dialogs require images of different sizes than the app icon, so that's probably the reason.
Not sure I agree. It's not like we have to import 2 different sizes for each dialog, it's just the one image, so that can't be the reason... And if we're just using the one image, ideally it would default to the app icon, perhaps with the option to pass the id of another image if desired as per current method. (As mentioned these aren't really bugs but may be worth considering as enhancement requests).


jacque wrote:
Sun May 07, 2023 6:06 pm
The cursor stack includes everything in the tools palette and other things as well so I think few people would need that. The OS pointer cursor is always available so unless you need all the others it's logical to allow the developer to choose.
Thanks Jacque - honestly it would never cross my mind that 'cursors' external would include everything in the tools palette... Is that really the case though? Opening the stack /Applications/LiveCode 9.6.9.app/Contents/Tools/Toolset/palettes/cursors/revcursors.rev simply shows me a card with a few tiny cursor bitmaps and not much else.
Honestly I don't see why this can't just be included for all standalones, it's not like it's a massive increase in stack size including a few tiny bitmaps.



Nevertheless, assuming there is a good reason not to include the tiny cursor bitmaps in every standalone, then at the very least this should mandate an update in the Dictionary API for Cursor.

At no point does it specify in the documentation that the developer needs to manually include the 'cursors' external. In fact it implies the opposite:
The built-in cursors and their recommended uses are:

none: Hides the cursor
busy: Use repeatedly during a long handler
watch: Use during a moderately long handler
<snip>
The implication of the wording 'built-in' suggests to the unwary that this are built-in, and no further care is needed, which is patently incorrect.

Not sure if others think these really do need an enhancement request?
S.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Small gotchas for standalones (app icon, cursors)

Post by jacque » Mon May 08, 2023 2:56 am

The cursor stack you saw is for Windows, there's a second one for Mac (revMacCursors.) That one has about 20, including some from the tools palette. Still, you're right it probably doesn't have much overhead.

Maybe it needs clearer documentation? Most of the other inclusions remind you to select them before building.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Small gotchas for standalones (app icon, cursors)

Post by jacque » Mon May 08, 2023 6:07 pm

I forgot to mention, regarding the different sizes, OS X uses either 32x32 or 64x64 icons depending on the type and usage of the dialog being displayed. I suppose LC could retrieve the app icon and resize it as needed though the results might not be as attractive as one we create ourselves. Reducing a 128 or 256 icon to 32 pixels could be iffy.

Since these globals are Mac only, I assume Windows does use the app icon. There must have been a reason, though I don't know what it is.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Small gotchas for standalones (app icon, cursors)

Post by richmond62 » Mon May 08, 2023 6:57 pm

Reducing 256 or 128 pixel icons would not be iffy were they SVG images.

So, surely, the first thing on the shopping list is a properly scaleable SVG image of the LC icon.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Small gotchas for standalones (app icon, cursors)

Post by richmond62 » Mon May 08, 2023 7:24 pm

SShot 2023-05-08 at 21.21.57.png
-
5 minutes work owing to the good offices of Inkscape: nothing quite like
top quality Open Source software.

Oh, and if you don't like the colours: just twiddle around with the overlay.
Attachments
LC SVGs.livecode.zip
Stack.
(20.55 KiB) Downloaded 100 times

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Small gotchas for standalones (app icon, cursors)

Post by jacque » Mon May 08, 2023 7:51 pm

richmond62 wrote:
Mon May 08, 2023 6:57 pm
So, surely, the first thing on the shopping list is a properly scaleable SVG image of the LC icon.
I believe an .icns file only accepts bitmapped images, usually png or jpeg.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Small gotchas for standalones (app icon, cursors)

Post by richmond62 » Mon May 08, 2023 8:07 pm

I believe an .icns file only accepts bitmapped images, usually png or jpeg.
Blast, worth a try.

Of course . . . it might be time to hack the ASK and ANSWER templates. 8)

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Small gotchas for standalones (app icon, cursors)

Post by stam » Mon May 08, 2023 11:30 pm

jacque wrote:
Mon May 08, 2023 6:07 pm
I forgot to mention, regarding the different sizes, OS X uses either 32x32 or 64x64 icons depending on the type and usage of the dialog being displayed. I suppose LC could retrieve the app icon and resize it as needed though the results might not be as attractive as one we create ourselves. Reducing a 128 or 256 icon to 32 pixels could be iffy.

Since these globals are Mac only, I assume Windows does use the app icon. There must have been a reason, though I don't know what it is.
I know the dictionary states this is for macOS, but the windows standalone wouldn't show the icon until I'd done this.
I suspect this probably is needed for both OS's, although can't confirm...

And yes, icns is not a vector format sadly. But I suspect better results from shrinking down a large bitmap than the opposite...

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Small gotchas for standalones (app icon, cursors)

Post by richmond62 » Tue May 09, 2023 8:55 am

But I suspect better results from shrinking down a large bitmap than the opposite...
BEST results may be achieved from shrinking one of my vectors to the size you require and taking a snapshot inwith LC,
and using that.

Post Reply