| ![[Previous]](../image-lib/prev.gif) | ![[Contents]](../image-lib/contents.gif) | ![[Index]](../image-lib/keyword_index.gif) | ![[Next]](../image-lib/next.gif) | 
Find the offset of a widget's origin
PhPoint_t *PtWidgetOffset( PtWidget_t *widget,
                           PhPoint_t *offset );
This function determines the offset of widget's origin from its disjoint parent widget.
A pointer to a PhPoint_t structure that's the offset of the widget's origin from its parent window (the widget's position is relative to this point), or NULL if an error occurs.
PtArg_t arg;
PhPoint_t *widget_pos;
PtSetArg( &arg, Pt_ARG_POS, &widget_pos, 0);
PtGetResources( labelwidget, 1, &arg );
if(PtWidgetOffset( labelwidget, &point))
{
    widget_position_relative_to_window.x = 
          point.x + widget_pos->x;
    widget_position_relative_to_window.y = 
          point.y + widget_pos->y;
}
Photon
| Safety: | |
|---|---|
| Interrupt handler | No | 
| Signal handler | No | 
| Thread | No | 
PtGetAbsPosition(), PtTranslateRect()
| ![[Previous]](../image-lib/prev.gif) | ![[Contents]](../image-lib/contents.gif) | ![[Index]](../image-lib/keyword_index.gif) | ![[Next]](../image-lib/next.gif) |