timer functions.

Home Forums General Programming timer functions.

  • This topic has 1 reply, 2 voices, and was last updated 9 years ago by atom.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8949
    Bomma72
    Participant
    • Topics: 20
    • Replies: 68
    • Total: 88

    Is there a way to call a sub with a timer, (in this case it would change the value of a slider to zero one value at a time) and then wait until this is finished and then continue?  I have the subs ready and they work however I can’t figure out how to use the timer so that it will pause while the timer is running.  In this way I could create an animation of all the sliders moving to zero one at a time.

    I thought about running the sub with the timer then doing a until loop and then checking the value of the slider but it this ends up hanging.  What I really need is a way to have the main sub wait until the called sub is finished, or even when the timer stops.  In that way I can set the child sub to stop the timer when I get to zero.

    I am aware I could just to a loop but I don’t get the animated effect.

     

     

    #8951
    atom
    Keymaster
    • Topics: 159
    • Replies: 2945
    • Total: 3104
    • ★★★★★

    There is a Timer class and there is a ComponentAnimator class. The first is a general timer the second is designed to move/resize/fade components on the panel. There is an example of both i think in the Panels folder of the Ctrlr installation. The rendering demo in the Panels section on top uses Timers. Check them out.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Programming’ is closed to new topics and replies.
There is currently 0 users and 62 guests online
No users are currently active
Forum Statistics
Threads: 2,495, Posts: 17,374, Members: 77,605
Most users ever online was 12 on January 22, 2019 3:47 pm
Ctrlr