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

Gridscreen: really weird values for Row and Col

I'm getting whacky values for row and col

col &h12 Integer val:13094412
row &h12 Integer val:65535

when the screen is first loaded. I zero out the row and col variables before I get the values from the screen, and then do a screen.setfocusedlistitem(row,col), and then when I get the values from the message port they are off in the ozone.

	if type(msg) = "roGridScreenEvent" then 
if msg.isScreenClosed() then
?"some mofo closed the damn screen!!!"
return -1
else if msg.isListItemFocused() then
row=msg.GetIndex()
?"row=";row
col=msg.GetData()
?"col=";col
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
9 REPLIES 9
renojim
Community Streaming Expert

Re: Gridscreen: really weird values for Row and Col

I've seen this as well. I print out WTF! on the debug console when it occurs. :mrgreen: I just do a sanity check on the values before using them.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
jbrave
Channel Surfer

Re: Gridscreen: really weird values for Row and Col

ok, I guess that is all I can do.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
TheEndless
Channel Surfer

Re: Gridscreen: really weird values for Row and Col

If I recall correctly, I think I've only ever seen that when setting focus on a row that doesn't have any items in it (or to an index higher than the content list count). Is that where you're seeing it, or does it happen randomly during execution?
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
renojim
Community Streaming Expert

Re: Gridscreen: really weird values for Row and Col

As I recall, it would occur randomly when I first display the grid. I don't believe it ever occurred after the initial display. I save and restore a grid object as necessary and set the focused item to either 0,0 or whatever the focused item was the last time I displayed the grid. The bogus isListItemFocused was always followed by a good one that matched the call to SetFocusedListItem, so I don't believe I was trying to set the focused item to something bogus. It's been a while, so I may not be remembering everything. Once I put in the sanity check, I pretty much forgot about it. Since it was random and not really reproducible, I just let it go.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
TheEndless
Channel Surfer

Re: Gridscreen: really weird values for Row and Col

"renojim" wrote:
As I recall, it would occur randomly when I first display the grid. I don't believe it ever occurred after the initial display. I save and restore a grid object as necessary and set the focused item to either 0,0 or whatever the focused item was the last time I displayed the grid. The bogus isListItemFocused was always followed by a good one that matched the call to SetFocusedListItem, so I don't believe I was trying to set the focused item to something bogus. It's been a while, so I may not be remembering everything. Once I put in the sanity check, I pretty much forgot about it. Since it was random and not really reproducible, I just let it go.

-JT

Same here. I ignore it if the index isn't valid, so I forget the exact situation, too, but the more I think about it, the more I seem to recall it being related to an initial focus event being raised after SetupLists, but before SetContentList... or something like that. Maybe related to scrolling the grid via the remote before all of the content has loaded...? I'm too lazy to test it out now.. 😛
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
jbrave
Channel Surfer

Re: Gridscreen: really weird values for Row and Col

Yeah, it happens on the first is focused event when the grid screen is loaded. The isfocused event fires off on load and has weird numbers. I just put "if row < 100 and col < 500 then" so it just ignores the weird numbers, the next event that fires has the correct numbers.

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

Re: Gridscreen: really weird values for Row and Col

Sounds like it's not initializing the value and just grabbing the numbers from ram.
0 Kudos
RokuKevin
Visitor

Re: Gridscreen: really weird values for Row and Col

I'm having trouble replicating this.... Do you have a small code snippet that exhibits this behavior?

--Kevin
0 Kudos
jbrave
Channel Surfer

Re: Gridscreen: really weird values for Row and Col

I'm sending you a PM now.

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