Hello, I'm Creating an App for Roku with Scene Graph Framework. I got problem at the beginning. When I create LabelList and download it to my Roku Stick, I press Up and Down buttons and nothing happens -- list doesn't update. Here's my code(took from
http://sdkdocs.roku.com/display/sdkdoc/ContentNode#ContentNode-Description)
<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2015 Roku Corp. All Rights Reserved. **********-->
<component name="labelScene" extends="Scene" >
<script type="text/brightscript" >
<![CDATA[
sub init()
m.list = m.top.FindNode("coreList")
m.content = createObject("RoSGNode","ContentNode")
addSection("Renderable Nodes")
addItem("Rectangle")
addItem("Rotated Rectangle")
addItem("Label")
addItem("Poster")
addItem("Video")
addItem("Video Zoom")
addSection("Animation Nodes")
addItem("Animation Vector 2D Interpolator")
addItem("Animation Color Interpolator")
addItem("Animation Float Interpolator")
addItem("Sequential Animation")
addItem("Parallel Animation")
addItem("Fade-In Animation")
addItem("Fade-Out Animation")
addSection("Control Nodes")
addItem("Timer")
addSection("Lists and Grids")
addItem("Poster Grid")
addItem("Markup Grid")
m.list.content = m.content
m.list.ObserveField("itemFocused", "printing")
m.top.setFocus(true)
end sub
sub printing()
print "Hello"
end sub
sub addSection(sectiontext as string)
m.sectionContent = m.content.createChild("ContentNode")
m.sectionContent.CONTENTTYPE = "SECTION"
m.sectionContent.TITLE = sectiontext
end sub
sub addItem(itemtext as string)
item = m.sectionContent.createChild("ContentNode")
item.title = itemtext
end sub
]]>
</script>
<children>
<LabelList
id="coreList"
translation="[160,92]"
itemSize="[440,48]"
itemSpacing="[0,0]"
sectionDividerHeight="48.0"
sectionDividerFont="font:MediumBoldSystemFont"
sectionDividerTextColor="0x880088FF"
drawFocusFeedback="true" />
</children>
</component>
Documentation says that Lists automatically response Key-pressings and so on