Forum Discussion
floatleftintera
16 years agoVisitor
Didn't have a chance to test it, but see if this doesn't work for you. Just cleaned up a few items that i noticed with some formatting...
function posterscr(posterlist as object) as object
poster.SetListDisplayMode("best-fit")
poster.SetContentList(PosterList)
' if isauthenticated then
' categories=["Search","Explore", "Tracks", "About","You"]
' else
categories=["Search","Explore"," Tracks","About"]
' end if
poster.SetListNames(categories)
poster.SetListStyle("flat-category")
poster.SetListDisplayMode("best-fit")
poster.SetFocusedList(0)
poster.SetFocusedListItem(0)
poster.show()
while true
msg=wait(0,port)
msgtype=type(msg)
message=msg.getmessage()
idx = msg.GetIndex()
if type(msg) = "roPosterScreenEvent" then
if msg.isScreenClosed() then
print "screen closed exit app"
return -1
else if msg.islistSelected() and idx=5 and isauthenticated=false then
authenticate()
return -1
else if msg.isListFocused() then
m.currentcategory=idx ' assign category to global variable
'figure out which category was selected
if idx = 0 then
print "search selected"
' handle search section selected
else if idx = 1 then
print "explore selected"
'handle explore section selected
else if idx = 2 then
print "top tracks selected"
'handle top tracks selected
'call display top tracks
else if idx = 3 then
print "about this app selected"
'show the about screen
end if
else if msg.isListItemSelected() then
if m.currentcategory = 0 then 'we are in search section
if idx = 0 then
posterlist.Append(searchTracks())
else if idx = 1 then
posterlist.Append(searchPeople())
else if idx = 2 then
posterlist.Append(searchGroups())
else if idx = 3 then
posterlist.Append(searchGenre())
end if
else
if m.currentcategory=1 then 'we are in Explore section
print "explore section bla bla"
else if m.currentcategory=2 then 'we are in Hot section
posterlist.SetContentList(GetHotStuff())
else if m.currentcategory=3 then 'we are in about section
posterlist.setContentList(About())
else if m.currentcategory=4 then 'we are in you section
print "its all you babe"
end if
end if
end if
end if
end while
end function