neowinston
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2017
08:47 AM
LabelList not displaying content
The LabelList below is not displaying on the screen. How to fix this? Thanks!
sub showLabelList()
m.top.visible = false
m.currentexample = createObject("roSGNode", "LabelListExample")
m.top.appendChild(m.currentexample)
m.currentexample.setFocus(true)
m.buttons.setFocus(false)
end sub
<?xml version = "1.0" encoding = "utf-8" ?>
<!--********** Copyright 2016 Roku Corp. All Rights Reserved. **********-->
<component name = "LabelListExample" extends = "Group" initialFocus = "exampleLabelList" >
<script type = "text/brightscript" >
<![CDATA[
sub init()
m.top.backgroundURI = "pkg:/images/rsgde_bg_hd.jpg"
example = m.top.findNode("exampleLabelList")
examplerect = example.boundingRect()
centerx = (1280 - examplerect.width) / 2
centery = (720 - examplerect.height) / 2
example.translation = [ centerx, centery ]
m.top.setFocus(true)
end sub
]]>
</script>
<children >
<LabelList id = "exampleLabelList" >
<ContentNode role = "content" >
<ContentNode title = "Renderable Nodes" />
<ContentNode title = "Z-Order/Parent-Child" />
<ContentNode title = "Animations" />
<ContentNode title = "Events and Observers" />
<ContentNode title = "On Demand Example" />
</ContentNode>
</LabelList>
</children>
</component>
4 REPLIES 4
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2017
08:56 AM
Re: LabelList not displaying content
Have you tried removing /. commenting out the line that says
m.top.visible = false
aspiring
neowinston
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2017
10:43 AM
Re: LabelList not displaying content
Thanks for your reply. I tried that but all the buttons, descriptions, etc from this DetailsScreen become mixed with the LabelList. I tried to set:
This is the crash log:
But it messed up the focus. Any suggestions?
m.buttons.visible = false
m.poster.visible = false
m.background.visible = false
m.description.visible = false
This is the crash log:
041: Sub OnFocusedChildChange()
042:* if m.top.isInFocusChain() and not m.buttons.hasFocus() and not m.videoPlayer.hasFocus() then
043: m.buttons.setFocus(true)
044: end if
045: End Sub
Interface not a member of BrightScript Component (runtime error &hf3) in pkg:/components/screens/DetailsScreen/DetailsScreen.brs(42)
042: if m.top.isInFocusChain() and not m.buttons.hasFocus() and not m.videoPlayer.hasFocus() then
But it messed up the focus. Any suggestions?
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2017
11:28 AM
Re: LabelList not displaying content
seems like you're on the right track but you need to debug that crash. does m.videoplayer exist at that point? maybe you need to set focus onto the labellist if it's not already?
aspiring
neowinston
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2017
12:07 PM
Re: LabelList not displaying content
Thanks for your help, my friend. I've put some if statements and for now it seems to work just fine.