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?

Yes. You need to respond to the button events and keep track of the setting in the user’s feed or registry…

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
 

Kevin,

Thank you for your response. I will give that a try.