I'm using the PanelSet
class to create a settings screen made of two panels:
panelA
on the left-hand side displays a list of overall settings optionspanelB
is displayed on the right-hand side, includes a list of different options for each item onpanelA
How can I replace the Panel
displayed on the right-hand side, when the user changes the focused item on panelA
?
Roku's documentation states that you have to use the method replaceChild
, but I can't figure out how that's supposed to work, or any examples. This is what I was trying but it doesn't work:
function showPanelInfo()
if m.panelA.list.itemFocused = 0
m.panelset.replaceChild(m.panelB, 3)
else
m.panelset.replaceChild(m.panelC, 3)
end if
end function
Function init()
m.panelset = createObject("roSGNode", "PanelSet")
' Left-hand side panel with two items list
m.panelA = m.panelset.createChild("OptionsListPanel")
' Right-hand side panels with different lists for each item on left-hand side panel
m.panelB = m.panelset.createChild("OptionsBPanel")
m.panelC = createObject("roSGNode", "OptionsCPanel")
m.panelA.list.observeField("itemFocused", "showPanelInfo")
...
end function