Find the offset of a widget's origin
PhPoint_t *PtWidgetOffset( PtWidget_t *widget, PhPoint_t *offset );
ph
This function determines the offset of widget's origin from its disjoint parent widget and stores it in the PhPoint_t structure pointed to by offset.
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 |
PhPoint_t, PhTranslateRect(), PtGetAbsPosition()