Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Menu Example Question

Can some one help me with my menu please, example code always welcome lol, I am currently working off of the DeviantArt Example in the 3.0 SDK

I want to have a Filter List Menu with 2 options (Option1, Option2)
When an option is selected it gets an rss feed to populate a Poster Menu with the items, title, and subtitle
the poster menu will act just like the one from deviantart and go get an RSS feed and put on a slideshow

I have the poster menu going just need to know how to have it call the correct rss based on the list filter menu selection, and have the poster menu populate from RSS/SD/HD


Thanks!!
Bobby
0 Kudos
4 REPLIES 4

Re: Menu Example Question

I dont mind Hard coding the menus to make things easier .. so if some one could just tell me how to add the filter list menu above the poster menus and it call the different poster menus that would be great! Thanks
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: Menu Example Question

"bobbydharrell" wrote:
I dont mind Hard coding the menus to make things easier .. so if some one could just tell me how to add the filter list menu above the poster menus and it call the different poster menus that would be great! Thanks


Setup a filter bar with SetListNames(), then handle the focus of a filter bar item within your event loop by checking for isListFocused(). These are both documented in the roPosterScreen section of the Component Reference.
0 Kudos

Re: Menu Example Question

"RokuChris" wrote:
"bobbydharrell" wrote:
I dont mind Hard coding the menus to make things easier .. so if some one could just tell me how to add the filter list menu above the poster menus and it call the different poster menus that would be great! Thanks


Setup a filter bar with SetListNames(), then handle the focus of a filter bar item within your event loop by checking for isListFocused(). These are both documented in the roPosterScreen section of the Component Reference.




Thanks RokuChris, I am going through that pdf now.

Here is what I have . I am having trouble figuring out what to heck and where to put the isListFocused()

'   HDPosterUrl As String - URI to HD Icon Image
' SDPosterUrl As String - URI to SD Icon Image
' ShortDescriptionLine1 As String - the text name of the menu item
' ShortDescriptionLine1 As String - more text
' Type as String - Old or New
'
' ******************************************************

function uitkPreShowPosterMenu(breadA=invalid, breadB=invalid) As Object
port=CreateObject("roMessagePort")
screen = CreateObject("roPosterScreen")
screen.SetMessagePort(port)
screen.SetListNames(["Old Testement", "New Testement"])
if breadA<>invalid and breadB<>invalid then
screen.SetBreadcrumbText(breadA, breadB)
end if
'screen.SetListStyle("flat-category")
screen.SetListStyle( "arced-landscape" )
screen.SetListDisplayMode( "scale-to-fit" )
screen.Show()

return screen
end function


function uitkDoPosterMenu(posterdata, screen, onselect_callback=invalid) As Integer

if type(screen)<>"roPosterScreen" then
print "illegal type/value for screen passed to uitkDoPosterMenu()"
return -1
end if

screen.SetContentList(posterdata)

while true
msg = wait(0, screen.GetMessagePort())

'print "uitkDoPosterMenu | msg type = ";type(msg)

if type(msg) = "roPosterScreenEvent" then
' print "Event.GetType()=";msg.GetType(); " Event.GetMessage()="; msg.GetMessage()
if msg.isListItemSelected() then
if onselect_callback<>invalid then
selecttype = onselect_callback[0]
if selecttype=0 then
this = onselect_callback[1]
this[onselect_callback[msg.GetIndex()+2]]()
else if selecttype=1 then
userdata1=onselect_callback[1]
userdata2=onselect_callback[2]
f=onselect_callback[3]
f(userdata1, userdata2, msg.GetIndex())
end if
else
return msg.GetIndex()
end if
else if msg.isScreenClosed() then
return -1
end if
end If
end while
end function


and this is what I have in my list:
	mainmenudata = [
{ShortDescriptionLine1:"Story01", ShortDescriptionLine2:"Stuff 1", HDPosterUrl:"HDimgURL1", SDPosterUrl:"SDimgURL1", Type:"old"}
{ShortDescriptionLine1:"Story02", ShortDescriptionLine2:"Stuff 2", HDPosterUrl:"HDimgURL2", SDPosterUrl:"SDimgURL2", Type:"new"}
{ShortDescriptionLine1:"Story03", ShortDescriptionLine2:"Stuff 3", HDPosterUrl:"HDimgURL3", SDPosterUrl:"SDimgURL3", Type:"old"}
{ShortDescriptionLine1:"Story04", ShortDescriptionLine2:"Stuff 4", HDPosterUrl:"HDimgURL4", SDPosterUrl:"SDimgURL4", Type:"new"}]
onselect = [0, rss, "Story01", "Story02","Story03", "Story04"]


I am wanting to filter the list by type, old and new

Thanks
0 Kudos

Re: Menu Example Question

Thanks ... I played with it and got it mostly working then decided to just not do the filter, looks cleaner without it .. Thank you so much for your help
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.