Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > RealBasic: Sliders controlling timers

RealBasic: Sliders controlling timers
Thread Tools
Fresh-Faced Recruit
Join Date: Sep 2001
Status: Offline
Reply With Quote
Jul 15, 2002, 05:18 PM
 
Heya,

I want to control the rate at which a timer is used, I figured I could use a slider to do this, but how to make it work? I tried this, but it doesnt work.

timer1.value = str(slider1.value)
     
Grizzled Veteran
Join Date: Sep 2000
Location: Springfield, MA
Status: Offline
Reply With Quote
Jul 15, 2002, 06:04 PM
 
Where are you getting the property timer1.value from and why is it a string? The timer base class has an interval property which is an integer:
timer1.interval = slider1.value
should work
We hope your rules and wisdom choke you / Now we are one in everlasting peace
-- Radiohead, Exit Music (for a film)
     
Fresh-Faced Recruit
Join Date: Sep 2001
Status: Offline
Reply With Quote
Jul 15, 2002, 07:03 PM
 
I was just guessing on the .value

That .interval doesnt work either <img border="0" title="" alt="[Frown]" src="frown.gif" />
     
Mac Elite
Join Date: Oct 2001
Status: Offline
Reply With Quote
Jul 20, 2002, 12:49 PM
 
You want timer1.period=slider1.value. There is a whole section in the online reference (press Command+1 to view and search for timer)

Remember, a value of 1000 for the timer=1 second, so make sure the slider walue is going to be big enough, or steps at certain intervals. You can do this by doing some rounding.

Also remember that 32767 will be a maximum possible value, because slider maximums cannot be any higher. So using a slider may not be the best approach anyhow. But then again, I don't know what you are trying to do.
Genius. You know who.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:03 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2