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: 
TheEndless
Channel Surfer

roOneLineDialog very resource intensive...?

I've found that the roOneLineDialog seems to eat up a lot resources while it's running, particularly if showing the busy animation. The following example illustrates this very well...

dialog = CreateObject( "roOneLineDialog" )
dialog.ShowBusyAnimation()
dialog.SetTitle( "Please wait..." )
dialog.Show()
' do initialization stuff
keyboard = CreateObject( "roKeyboardScreen" )
keyboard.SetMessagePort( CreateObject( "roMessagePort" ) )
keyboard.AddButton( 0, "OK" )
keyboard.Show()
While true
msg = wait( 0, keyboard.GetMessagePort )
If msg.IsButtonPressed() Then
Return
End If
End While

When you run the above code, you'll find that the cursor is extremely sluggish when moving around the keyboard. The obvious solution is to Close() the dialog before entering the while loop, but all other screens seem to stop processing when they lose focus, while the dialog doesn't. I have some screens in my app that take a few seconds to paint, so closing the dialog before the screen paints isn't very smooth from a UI perspective. I've gotten around it by passing the dialog to my custom screen, so it can close it before entering its wait loop, but I'm curious as to why it behaves the way it does.

TheEndless
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
1 REPLY 1
greubel
Visitor

Re: roOneLineDialog very resource intensive...?

I've found that ShowBusyAnimation() chews up about 50% of the system.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.