Problem with Widget Spinner

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
CAsba
Posts: 432
Joined: Fri Sep 30, 2022 12:11 pm

Problem with Widget Spinner

Post by CAsba » Thu Aug 01, 2024 12:06 pm

Hi,
Using this code

Code: Select all

  lock screen
   send "mouseup" to btn "inputdg3" 
   unlock screen
   show widget "spinner"
   send "mouseup"  to btn "setDG "  
   send "mouseup" to btn "listanother" of cd "manage products"
The widget shows, but does not 'spin'.
This in the IDE, haven't tried in standalone.
Any ideas ?

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

Re: Problem with Widget Spinner

Post by richmond62 » Thu Aug 01, 2024 12:40 pm

Here's something "babyish" made with LC 8.2 DP 2 (because I happen to be in front of a machine running MacOS 10.7.5 today). 8)
-
Screen Shot 2024-08-01 at 2.36.34 pm.png
-
Button code:

Code: Select all

on mouseUp
   if the vis of widget "Spinner" is true then
      set the vis of widget "Spinner" to false
      set the label of me to "SHOW"
   else
      set the vis of widget "Spinner" to true
      set the label of me to "HIDE"
   end if
end mouseUp
Give it a whirl: if it works on your machine it is your code: if it doesn't work then it must be something a bit wrong with your machine.
Attachments
Spin Me.livecode.zip
Stack.
(940 Bytes) Downloaded 263 times

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Problem with Widget Spinner

Post by bn » Thu Aug 01, 2024 2:40 pm

Hi Casba,

the widget spinner is not spinning while LC is executing. You can make it spin if you add

Code: Select all

 wait 0 milliseconds with messages
occasiionally.

This script only shows that the widget spins during a lengthy script:

Code: Select all

on mouseUp
   repeat with i = 1 to 100000000
      put " fljlakjf lkasjd ölkajd lköas " into tTemp
      if i mod 10000 is 0 then
         wait 0 milliseconds with messages
      end if
   end repeat
   beep
end mouseUp
If you wait too often it will slow down execution time too much, if only a couple of times spinner will advance only slowly.

Kind regards
Bernd

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 324
Joined: Sat Aug 16, 2008 9:48 am
Contact:

Re: Problem with Widget Spinner

Post by SWEdeAndy » Thu Aug 01, 2024 3:17 pm

I find the spinner widget rather useless, as it tends to freeze precisely when you want it to spin: during lockScreen or database fetches.

A good alternative is to use a browser widget spinner, which always spins:
https://wheninspace.com/browseranimation/
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
(WIS_WebDeployHelper, WIS_ScriptDependencies, WIS_BrowserAnimation)
WhenInSpace: https://wheninspace.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Problem with Widget Spinner

Post by FourthWorld » Thu Aug 01, 2024 5:09 pm

SWEdeAndy wrote:
Thu Aug 01, 2024 3:17 pm
I find the spinner widget rather useless, as it tends to freeze precisely when you want it to spin: during lockScreen or database fetches.
It would be very convenient if GIF animation was asynchronous.
https://quality.livecode.com/show_bug.cgi?id=7600
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

PaulDaMacMan
Posts: 683
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Problem with Widget Spinner

Post by PaulDaMacMan » Mon Aug 12, 2024 10:40 pm

CAsba wrote:
Thu Aug 01, 2024 12:06 pm
The widget shows, but does not 'spin'.
This in the IDE, haven't tried in standalone.
Any ideas ?
Could it be that this Spinner Widget does not spin only when the IDE is in 'Edit Mode'? Does it spin if you're on the Browser Tool?
I believe Widget OnTimer is execution context sensitive, I don't think it runs when the IDE is in Edit Mode.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

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

Re: Problem with Widget Spinner

Post by stam » Tue Aug 13, 2024 7:50 pm

yeah, it spins for me during long pulls with blocking code - but only in browse tool, not pointer tool (ie when running, not editing, the stack).

Post Reply