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: 
dynamitemedia
Binge Watcher

screen wont close

Here is my code for a keyboard screen for the search....

if msg.isButtonPressed() then
if msg.GetIndex() = 1

search = screen.GetText()
RegWrite("search", search)

SearchResultsMain()
exit while

end if ' if 1
if msg.GetIndex() = 2

exit while
end if ' 2
end if
end if
end while

screen.Close()


its strange cause it keeps flashing when i click up and out of the search. and in fact it is not closing at all behind itself. even when i go to a different category and leave it, will flash the keyboard again.

if you hit the #2 which is a button saying "Go Back" no problems it doesnt flash
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
9 REPLIES 9
TheEndless
Channel Surfer

Re: screen wont close

It looks like you displaying the search results before you close the keyboard screen/exit your while, which would cause the flickering you're seeing. Try moving (or adding) screen.Close() to just before your call to SearchResultsMain().
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
dynamitemedia
Binge Watcher

Re: screen wont close

tried that endless now its acting even stranger... in fact have tried that before but its just jumping around

when i hit the search button it flashes back to the homeScreen and the "search" icon then to the search results page

and if i got to say the MMA shows and exit out it also flashes to the "search" icon on the Homescreen
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
jbrave
Channel Surfer

Re: screen wont close

Try putting your search screen into a function that returns the results. When the sub or function ends, the screen should close as it only exists in that context if you do your createobject("rosearchscreen") in the sub. Don't use an m. variable for creating a screen object that you use in a sub or function or it won't close correctly, since it still exists.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
dynamitemedia
Binge Watcher

Re: screen wont close

Joel, i have to say i have no idea what you mean...

its the keyboard screen thats giving me the issues, the search is a function and is closing.

EDIT: i am using keyboard not the roSearch
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
jbrave
Channel Surfer

Re: screen wont close

I mean, you have screen, be it an rosearchscreen or an rokeyboard screen, shouldn't matter what

Put all your code that deals with the screen inside a function: (might be some mistakes, i'm trying to communicate a general idea here):

function keyscreen() as string
screen=CreateObject("rokeyboardscreen")
port=createobject("romessageport")
screen.SetMessagePort("port")
while true
msg=wait(0,port)
if msg.isButtonPressed() then
if msg.GetIndex() = 1

search = screen.GetText()
RegWrite("search", search)
SearchResultsMain()
exit while
end if ' if 1

if msg.GetIndex() = 2
exit while
end if ' 2
end if
end while
return search
end function
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
jbrave
Channel Surfer

Re: screen wont close

What does SearchResultsMain() do?

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
dynamitemedia
Binge Watcher

Re: screen wont close

you know what Joel, my keyboard screen is just like that now. what seems to be the issue right now isnt even on the search i think but the HomeScreen.

seems what it is doing with any of the categories i pushed into the home screen, is that they just "flash" to the icon of the last category selected or msg.is ListItemSelected() . then they go back to the first category i pushed into the home screen

this is only happening when using up to exit any categories i forced in with a push. so it also could be in the "sub main() "

I will play around with it when i get done with dinner, there must be a way maybe even using your "Refresh" idea 😉 to stop that.

its really not a huge deal now, better than that keyboard popping up! thanks endless putting that screenclose seemed to stop that. i had the screen close at the bottom like the normal keyboard example, but of course this channel isn't a normal channel!
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
TheEndless
Channel Surfer

Re: screen wont close

It honestly sounds like you've got multiple poster screens with the same content on them, hence the bizarre flashing of content. Is it possible you're recreating the screen in some cases instead of closing the screen on top?
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
RokuKevin
Visitor

Re: screen wont close

Did you try modifying the example code for the roSearchScreen in the Component Reference Guide?

That should be a good working example to start with and modify.

--Kevin
0 Kudos