Hi, just getting started with SG, I'm old school SDK trying to catch up. I'm trying to launch a dialog and when user clicks OK, it ends the app. I was trying to use the "dialog example" from Roku.
So what I do is call the below sub which displays the dialog shown in XML file below. My problem is once user clicks OK, I want to close the app. Right now, when I click OK, nothing happens because its doing nothing but returning Boolean value. I'm not sure what I need to call at this point to kill the app. I tried a roUrlTransfer call but it errors out on the SetUrl property ("http://localhost:8060/keypress/Home
"). I assume this type of call won't work in the onKeyEvent so do I need to return focus somehow to the screen so I can close it?
Any help would be appreciated.
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
scene = screen.CreateScene("DialogExample")
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
<component name = "DialogExample" extends = "Scene" >
<script type = "text/brightscript" >
m.top.backgroundURI = "pkg:/images/rsgde_bg_hd.jpg"
dialog = createObject("roSGNode", "Dialog")
dialog.backgroundUri = "pkg:/images/rsgde_dlg_bg_hd.9.png"
dialog.title = "My title"
dialog.optionsDialog = true
dialog.message = "Press * To Dismiss"
m.top.dialog = dialog
function onKeyEvent(key as String, press as Boolean) as Boolean
if press then
if (key = "OK") then