Adjust the size of a widget
int PtAttemptResize( PtWidget_t *widget, PhRect_t const *canvas, PhRect_t const *render );
This function adjusts the size of the widget based on the differences between canvas and render and on the widget's resize flags.
PtResizeCanvas() is similar to this function but easier to use. You should call it instead of PtAttemptResize().
The widget's actual size is modified (widget->area.size). If the resize policy of the widget prevents PtAttemptResize() from adjusting the widget's size (i.e. the canvas won't fit within the provided render rectangle), PtAttemptResize() sets the Pt_UCLIP bit of the widget's resize flags. If this bit is set, the widget's Draw method should apply clipping via PtClipAdd() prior to rendering its data.
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PtChildBoundingBox(), PtClipAdd(), PtClipRemove(), PtResizeCanvas()
PgExtentText(), PhRect_t, PtCalcCanvas() in the Photon Library Reference