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: 
neowinston
Visitor

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>
0 Kudos
4 REPLIES 4
joetesta
Roku Guru

Re: LabelList not displaying content

Have you tried removing /. commenting out the line that says 
 m.top.visible = false
aspiring
0 Kudos
neowinston
Visitor

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:


    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? 
0 Kudos
joetesta
Roku Guru

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
0 Kudos
neowinston
Visitor

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.
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.