get widget's absolute pos....??

Hello…

I want to get widget’s absolute pos…

the widget is custom widget, in window(parent).

Please help me…

[code]PhPoint_t pos;
PhRid_t rid;
PhRect_t area;
PhRegion_t reg;

rid = PtWidgetRid(wgt);

PhRegionQuery(rid, &reg, &area, NULL, 0);
area.ul.x += reg.origin.x;
area.ul.y += reg.origin.y;

pos = area.ul;[/code]

This example gets absolute position of region assigned to widget wgt
If you know widget’s relative position to this region you have the absolute position.

In your case, your window have region beginning at its own origin, therefore you probably can use rid = PtWidgetRid(window) where window is your parent window …

thanks…

i did it…but i couldn’t get widget’s absolute pos…

just i got relative position in window…

hmm…

i use that code …

thanks…

i found api…

PtGetAbsPosition(PtWidget_t *, int *, int *)