Can has Answer/Ask -like progress bar?

Organizing tasks to work on, New Features Ideas, Building LCS & LCB Libraries & Widgets, Redecorating and Modifying the IDE, Hacking / Editing Tools, Compiling the Engine from Source, etc.
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Can has Answer/Ask -like progress bar?

Post by OpenXTalkPaul »

I think it's long past time there's some sort of universal abstraction for a 'progress bar display window', and in a way similar to Answer/Ask that gets special treatment like being auto added to standalones that have script(s) that call for those.

What has me thinking about this again is that I find myself in 2024 STILL using the old 'set cursor to busy' repeatedly within scripts whenever I want the user (me usually) to know that a script is still processing (vs. engine being locked up or script is in an infinite repeat loop with Lock Screen and Messages locked). It's a quick and dirty thing to copy-paste a few of those into a repeat loop, and I always say that I'll go back later and replace it with something nice looking but rarely get around to it.

Back in the Hypercard days there was a plethora of progressbar externals that could be simply be copied into a stack to replace the quick and dirty 'set cursor to busy' cursor animation with something standard or in a slightly more more-modern UIs (mac 'Platinum' OS 8 / 9 / Carbon in the late 90s). The black and white cursor animation looks soooooo HC 1980s, but at least you can't confuse it with the OS's application locked-up 'spinning beachball' cursor, lol. But if we had a standard progress windoid stack we could call on, update, and close from our scripts and have some guarantee that it the stack would be there (and hopefully kept up to date with the latest UI trends, like the 'Knight-Rider Progress' in newer macOS), and be auto included when we export, well then maybe I wouldn't need to still be using the same quick & easy line that I used for this purpose in HC 1.x, circa 1987!

I don't think it needs to be anything fancy, but calling this Progress windoid would need to have a least 3 parameters:
'Progress Text', 'Percentage Compete' (perhaps mapped to 'thumbPosition' property), and optional 'Cancel Button Label' params.

Does anyone have such a thing made up already that they use regularly that they'd like to put forward? I think I've made one (or two) up myself at some points over the years, probably as sub-stacks in stacks that I've forgotten about.
User avatar
richmond62
Posts: 2774
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by richmond62 »

Here's something I made earlier (2010) which is NOT what you want, BUT might serve as a jumping off thing:
-
Screenshot 2024-03-26 at 10.11.28.png
Screenshot 2024-03-26 at 10.11.28.png (26.36 KiB) Viewed 470 times
-
Obviously you'll have to hack the script to blazes. 8-)

If some clever person could wiggle that into a widget . . .

Or, being cruder, set it up as a substack of the mainstack that shows up as a modeless window (also has the advantage of blocking access to the mainstack).
Attachments
PROGRESS.livecode.zip
(2.13 KiB) Downloaded 8 times
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 2774
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by richmond62 »

Here's something slightly better insofar as the progress bar is a modeless substack:
-
Screenshot 2024-03-26 at 10.36.20.png
Screenshot 2024-03-26 at 10.36.20.png (43.52 KiB) Viewed 468 times
Attachments
PBDEMO.oxtstack.zip
(2.39 KiB) Downloaded 5 times
https://richmondmathewson.owlstown.net/
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by xAction »

Windows system loading progress is a font.
Click the character map tab and scroll way down to see the characters it uses for the spinner.
Could make or use something like this which gets included in the build process.

Can you set the cursor to a font?
A script that exports a snapshot from the rect of a graphic that's been set to a character of a font could do the trick.
If the cursor is what you want to do.

Where is 'busy' defined? Being able to overwrite that would be useful.
User avatar
richmond62
Posts: 2774
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by richmond62 »

see the characters it uses for the spinner
That's entirely possible.

But what is being looked for is some sort of progress bar.
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1537
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by tperry2x »

'busy' is defined at engine level as an internal function.
It could be extended, given enough time and effort.

I'd like to have some built in dialog - rather than just ask / answer, have another called "notify"
This could not only handle UI hints like a spinner to let the user know things are still happening, but it might be good to have a unified way of supporting notification alerts within OXT too?

Just an idea.
I like the idea of setting the cursor to something other than the black and white spinner.
Perhaps (not this exact one) - which is only a quick grab from google search
dual-ring-loader-3980717081.gif
dual-ring-loader-3980717081.gif (99.91 KiB) Viewed 463 times
But having something like a revised and slightly more modern take on the black & white Classic-Mac-Style spinner would be good. It's easy to replace as although the function is inside the engine code, externally it's looking for cursor image resources you can change.

It's in the 'revCursors' stack, images named "c16" through to c23"
Screenshot at 2024-03-26 14-25-10.png
Screenshot at 2024-03-26 14-25-10.png (4.1 KiB) Viewed 462 times
User avatar
richmond62
Posts: 2774
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by richmond62 »

That ring is certainly a lot betetr than the ancient BW thing. But you'll have to remove the "white fuzzies".
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1537
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by tperry2x »

richmond62 wrote: Tue Mar 26, 2024 2:24 pm That ring is certainly a lot betetr than the ancient BW thing. But you'll have to remove the "white fuzzies".
Yes, absolutely - like I say, not that one in particular. That was just grabbed from Google as a quick demo of what I mean.
User avatar
richmond62
Posts: 2774
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by richmond62 »

Mind you, that is NOT a progress bar.

My primitive 'thingy' is.
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 2774
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by richmond62 »

Here's a place worth poking about in a bit:

https://web.archive.org/web/20100906224 ... downloads/
-
Screenshot 2024-03-26 at 20.01.10.png
Screenshot 2024-03-26 at 20.01.10.png (58.78 KiB) Viewed 448 times
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 2774
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by richmond62 »

Ever so slightly childish fun:
-
Screenshot 2024-03-26 at 20.33.43.png
Screenshot 2024-03-26 at 20.33.43.png (40.45 KiB) Viewed 446 times
Attachments
proGBAR.oxtstack.zip
(2.36 KiB) Downloaded 6 times
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by OpenXTalkPaul »

Replacing the black and white cursor to something that looks newer than 1980s would be great too, I believe all modern operating systems now support larger cursors and color cursors.

But I meant the sort of modal or modeless window that Richmond posting. If something like that was always available to the IDE like Ask/Answer and it was easy to call with some simple syntax then I'd use that instead of a cursor animation. The reason I've use 'set cursor to busy' a lot is purely due to convenience. Plus it seems that all xTalks have supported that mechanism.

A 'notifications' window might be good too or maybe it could be the same stack you could use with or without an animated progress indicator (invisible when the 'progress' value is not set or set to empty).

The main thing is that it will always be available to our stacks when something like that suddenly becomes needed and this stack should maintain compatibility with the original syntax if there's any updates.

BTW, at one point I did actually make a version of 'Answer' stack that is square and has up to 4 buttons (stacked 1 column x 3 buttons down or 2 columns x 2 buttons each) just like newer versions of macOS have done with the system's 'Answer' dialog. I wanted it to check the OS version and then enabled that 'mode' for BigSur (macOS 11) +. I modeled it based on screenshots from BigSur as seen when doing things like emptying the trash can in the Finder. Although I think Apple has changed that again slightly since then. Matching an OS'es look is an forever moving target.
User avatar
richmond62
Posts: 2774
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by richmond62 »

But I meant the sort of modal or modeless window that Richmond
cobbled together in a very simple way.

My first example (from 2010) is over complicated as it employs 4 images: one of which gets stretched, and a "frotn" that gets 'pushed' along in front of the stretched image.

The new one I made yesterday is far, far simpler insofar as it only uses 2 images: a background 'track' and an 'Aqua' progress bar that gets stretched.

Download the new stack and take it to pieces.

The snags about those rotary progress indicators are:

1. Chummy can see no end to the progress.

2. They either employ a GIF, or a multiplicity of frames.
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 2774
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by richmond62 »

Damn: I knew I shouldn't have had that 13th cup of coffee:
-
Screenshot 2024-03-27 at 10.51.31.png
Screenshot 2024-03-27 at 10.51.31.png (171.84 KiB) Viewed 429 times
-
You can make your brain go funny WITHOUT the 'benefit' of coffee right here with "Uncle Richmond's" evil creation. 8-)
Attachments
Brain Fudge.oxtstack.zip
(2.75 MiB) Downloaded 8 times
https://richmondmathewson.owlstown.net/
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by xAction »

can't you do:

ask and/or
answer with stack "such and such?"
oh you can't. Weird, always thought that was a thing.

Okay then
popup stack "watch this paint dry while I process the data " at 0,0
works like the thing you are looking to accomplish, could even set the overlay stack to some transparency for that classic "Ha, I stopped you from using the interface and piling up errant messages while you wait!" look.

The overlay stack can't animate if the original stack is using repeat loops that block all other messages on account of no multi-threading...unless GIF maybe? Or some update_overlay_stack message of course.
User avatar
tperry2x
Posts: 1537
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by tperry2x »

I also thought you could have an unobtrusive window, something like the popup I'm using here, which could update with a progress bar in much the same way you mention above. Again, just an idea.
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by OpenXTalkPaul »

Like Richmond, I also dislike those indicators, like the Windoze 'Circles Chasing Circles' or the newish Mac 'Knight Rider' indicator, that are nonspecific about exactly how much progress has been made and how much is left to go. Although I do understand that sometimes such info can't be known ahead of time in certain situations, like for example when a download's byte/file-size is not yet known, so I would want this to have option(s) for a non-percentage-specific based activity indicator(s).

That reminds me, do we have a 'counting fingers' cursor like the classic macOS had? I quite liked that one.
The overlay stack can't animate if the original stack is using repeat loops that block all other messages on account of no multi-threading...unless GIF maybe? Or some update_overlay_stack message of course.
Another option might be using a Widget, running in the UI thread independent of script execution (as seen with the Analog Clock widget), but you would still need to update the thing somehow from within your locked-down repeat loop. Maybe unlock messages, set its progress bar widget's progressPercentage property, then lock messages again? Hmmm....

I have made a progress bar widget that I can test with already. It is similar to one released by Trevor Devore but with a few more options, for example my version can be horizontal OR vertical orientations (so that it can easily be used in ways such as an Audio-Input level meter).
User avatar
tperry2x
Posts: 1537
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by tperry2x »

OpenXTalkPaul wrote: Fri Mar 29, 2024 2:13 am That reminds me, do we have a 'counting fingers' cursor like the classic macOS had? I quite liked that one.
You mean this one?
loading.gif
loading.gif (526 Bytes) Viewed 352 times
I was thinking of updating the black & white 'spinner' to a colour version of this hand, in OXT Lite.
User avatar
richmond62
Posts: 2774
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by richmond62 »

I prefer the one I just made (but I would):
-
Handy.gif
Handy.gif (1.92 KiB) Viewed 349 times
-
Also. much more appropriate for us who were brought up with Pounds, shillings, and pence. ;)
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1537
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Can has Answer/Ask -like progress bar?

Post by tperry2x »

'handy' if you had 6 digits, but otherwise, think I'll stick with the original -, then coloured & digit sequence reordered.
Here's a revised mono and colour version.
I've elected to keep these at the standard 16px sizes, because anything higher looks a bit like 'fisher-price' play-cursors in my opinion.
hand-count-logical-bw.gif
hand-count-logical-bw.gif (531 Bytes) Viewed 336 times
hand-count-logical-col.gif
hand-count-logical-col.gif (897 Bytes) Viewed 336 times
Demo of it in action, having replaced the mono-beachball/radiation spinner
https://www.tsites.co.uk/otherstuff/new-hand.m4v
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests