georgemandres
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2010
06:09 PM
ThumbsUpDownButton
Is there a way to set the value of the thumbsupdownbutton?? Let's say that content comes up that was set to thumbsup before. Can i set the button to reflect that it has already been set?
2 REPLIES 2

RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2010
07:28 PM
Re: ThumbsUpDownButton
Yes. You need to respond to the button events and keep track of the setting in the user's feed or registry...
Example:
Example:
screen = CreateObject("roSpringboardScreen")
' Your code to setup springboard page
'Get cur_rating from your feed.. set to zero below as example
cur_rating = 0
screen.AddThumbsUpDownButton(4,cur_rating)
screen.Show()
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roSpringboardScreenEvent"
if msg.isButtonPressed()
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
if msg.GetIndex() = 4 then ' thumbsupdownbutton
thumbRating = msg.GetData()
if thumbRating = 1
if cur_rating = 1
print "already thumbs up"
else
print "change to thumbs up"
cur_rating = 1
'send rating to user's feed
endif
else if thumbRating = -1
if cur_rating = -1
print "already thumbs down"
else
print "change to thumbs down"
'send rating to user's feed
endif
endif
endif
' process other buttons
endif
' process other events for springboard
endif
end while
georgemandres
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2010
05:23 AM
Re: ThumbsUpDownButton
Kevin,
Thank you for your response. I will give that a try.
Thank you for your response. I will give that a try.