Invoke the Extent method of the specified superclass
void PtSuperClassExtent( PtWidgetClassRef_t *wc_ref, PtWidget_t *widget );
This function invokes the Extent method of the specified superclass wc_ref.
The PtLabel class's Extent method handles multiline text (with underlining and margins) and the resize policy.
The PtContainer class's Extent method handles the resize policy for all its subclasses.
The PtGraphic class's Extent method calculates an extent based on an array of points, line weight, origin, and resize policy.
To have a widget honor a minimum x dimension resource:
static void my_container_extent( PtWidget_t *widget ) { MyWidget_t *mw = (MyWidget_t *)widget; PhRect_t canvas, render; if( PtResizePolicy( widget ) ) { PtChildBoundingBox( widget, &canvas, &render ); if( render.lr.x - render.ul.x + 1 < mw->min_x ) render.lr.x = render.ul.x + mw->min_x -1; PtAttemptResize( widget, &canvas, &render ); }else if( widget->area.size.x < mw->min_x ) widget->area.size.x = mw->min_x; PtSuperClassExtent( PtBasic, widget ); }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |