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

You should be able to use one of the subBoundingRect methods to find the position of the focused item.

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