Как отобразить диалог внутри диалога в Roku? - PullRequest
0 голосов
/ 09 января 2020

Я пытался отобразить как диалоговое окно внутри диалогового окна в Roku. Но не в состоянии отобразить это правильно. Я использовал следующий код.

sub showdialog()
  optiondialog = createObject("roSGNode", "Dialog")
  optiondialog.title = "Options"
  optiondialog.buttons=["Another Dialog","Exit"]  
  m.top.dialog = optiondialog
  m.top.dialog.observeField("buttonSelected","onVerifyOption")   
  m.top.dialog.setFocus(true)  

end sub

function onVerifyOption()
    if m.top.dialog.buttonSelected = 0
        m.top.dialog.visible = false
        m.top.dialog.close = true   
        anotherdialog= createObject("roSGNode", "Dialog")
        anotherdialog.backgroundUri = "pkg:/images/keyboardbackground.jpg"
        anotherdialog.title = "Another Dialog"
        anotherdialog.message = "new Dialog"
        m.dialog = anotherdialog
        m.dialog.observeField("buttonSelected","onAnother") 
        m.dialog.setFocus(true)  
  else if m.top.dialog.buttonSelected = 1
        ?"Exit Dialog"
  end if
    return true
end function

function onAnother()
    if m.top.dialog.buttonSelected = 0 
        m.top.dialog.visible = false
        m.top.dialog.setFocus(false)
        m.top.dialog.close = true
    end if  
    return true
end function
...