roSGScreenEvents are events sent to a scene graph roSGScreen by the framework. Other than when notifying the channel's main BrightScript thread that the screen is being closed, and thus that the channel should be terminated, channels do not generally handle these events.
isScreenClosed() as Boolean
Sent to the screen when it is closed. Channels respond to this event by exiting the main BrightScript thread to exit the application.
Handling the isScreenClosed Event to Terminate a Channel in source/main.brs
sub Main() showChannelSGScreen() end sub sub showChannelSGScreen() screen = CreateObject("roSGScreen") m.port = CreateObject("roMessagePort") screen.setMessagePort(m.port) m.scene = screen.CreateScene("SimpleCaptionsScene") screen.show() while(true) msg = wait(0, m.port) msgType = type(msg) if msgType = "roSGScreenEvent" if msg.isScreenClosed() then return end if end while end sub