Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
monkeysource
Level 7

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
TheEndless
Level 7

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
Level 7

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