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: 
belltown
Roku Guru

Re: Really modal dialog

The defining characteristic of a modal dialog is that it prevents user interaction with the rest of the UI until the dialog is dismissed. And if the user REALLY can't interact with the rest of the UI until the dialog is dismissed then you have a 'REALLY modal dialog'. The Scene Graph Dialog component provides a 'REALLY modal dialog'.

You need to understand a fundamental principle of Scene Graph architecture: The render thread is completely, 100% event-driven. The init() function registers event handlers. The rest of the code in a component defines the event handlers, which get called in response to specific events. This is not the type of architecture where you have a main program loop that waits for user-input, processes the input, then goes back to waiting for the next input, etc. Your program code never waits (nor executes) until the system detects an event that it needs to handle (e.g. a button-click), then calls the appropriate event-handling function, which handles the event, then exits. If you understand that already, then great. If not, you have some more studying to do.

JavaScript browser applications work exactly the same way -- with one exception: They allow functions such as prompt() and alert() to block the render thread while waiting for user input. It sounds to me like the question you're really asking is: "Can a Scene Graph render thread block while waiting for user input?" The answer to that question is unequivocally, NO. The reason is that Roku chose not to allow it, whereas the JavaScript creators did choose to allow it. There may be any number of reasons for their respective decisions, but that's just the way it is. REALLY.
0 Kudos
RokuNB
Roku Guru

Re: Really modal dialog

^^^ What he said 🙂
0 Kudos