pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edvin Syse <ed...@sysedata.no>
Subject Re: Drag and Drop in TreeView - need to convert y coordinate?
Date Tue, 07 Jun 2011 18:54:11 GMT
Never mind, just found it :)

int relativeY = component.mapPointFromAncestor(getWindow(), 0, y).y;

-- Edvin

Den 07.06.2011 20:31, skrev Edvin Syse:
> My TreeView has a DragSource and DropTarget used to allow moving nodes
> around. In DropTarget#drop, I try to get the node the user dropped on
> like this:
>
> Sequence.Tree.get(getTreeData(), getNodeAt(y))
>
> .. but it seems y is relative to the window, and getNodeAt() expects
> coordinates relative to the component (TreeView). Is there method to
> convert the coordinates, or should I use another approach?
>
> -- Edvin

Mime
View raw message