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: 
monkeysource
Visitor

Markup Grid get focussed Child

Hi,

I have a MarkupGrip and am observing the itemFocused field. However, I'm struggling to get the focused child Node then this event is fire. 

In the below code I can get the focused index and content, but what a I really what is the SG Node so I can find out it's screen position. 

Sorry if this is a newbie question. 






sub onItemFocused()
    focused = m.grid.itemFocused
    content = m.grid.content.getChild(focused)
    ' but how to get the Node for the focused item. I'd like this so I can find out it's position on screen
end sub







Thanks,

Ryan
0 Kudos
2 REPLIES 2
TheEndless
Channel Surfer

Re: Markup Grid get focussed Child

You should be able to use one of the subBoundingRect methods to find the position of the focused item.
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
monkeysource
Visitor

Re: Markup Grid get focussed Child

Thanks, subBoundingRect does work. But the odd thing is, the string passed as the item number seems to be ignored. 

For a 30 item grid the following always produces the same result:



grid.subBoundingRect("item1")
grid.subBoundingRect("item20")


The Rect returned is always the rect of the focused cell and not the rect of the item in the grid. Is that by design?

Thanks,

Ryan
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.