Page 1 of 1

Problem with Widget Spinner

Posted: Thu Aug 01, 2024 12:06 pm
by CAsba
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 ?

Re: Problem with Widget Spinner

Posted: Thu Aug 01, 2024 12:40 pm
by richmond62
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.

Re: Problem with Widget Spinner

Posted: Thu Aug 01, 2024 2:40 pm
by bn
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

Re: Problem with Widget Spinner

Posted: Thu Aug 01, 2024 3:17 pm
by SWEdeAndy
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/

Re: Problem with Widget Spinner

Posted: Thu Aug 01, 2024 5:09 pm
by FourthWorld
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

Re: Problem with Widget Spinner

Posted: Mon Aug 12, 2024 10:40 pm
by PaulDaMacMan
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.

Re: Problem with Widget Spinner

Posted: Tue Aug 13, 2024 7:50 pm
by stam
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).