PtResizeCanvas()

Set the size of a widget's canvas

Synopsis:

int PtResizeCanvas( PtWidget_t *widget,
                    PhDim_t const *render );

Arguments:

widget
A pointer to the widget whose canvas you want to set.
render
A pointer to a PhDim_t structure (see the Photon Library Reference) that defines the desired size of the canvas.

Description:

This function changes the canvas belonging to the given widget to be the size specified in the PhDim_t pointed to by render.

This function is similar to PtAttemptResize(), but is easier to use.

The widget's actual size, widget->area.size, is modified. If the widget's resize policy prevents PtResizeCanvas() from adjusting the widget's size (i.e. the canvas won't fit within the provided render rectangle), PtResizeCanvas() sets the Pt_UCLIP bit in the widget's resize flags. If this bit is set, the widget's Draw method should apply clipping via PtClipAdd() before rendering its data.

Returns:

0 if the size didn't change, or nonzero if the height or width changed.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtAttemptResize(), PtChildBoundingBox(), PtClipAdd(), PtClipRemove()

PgExtentText(), PhDim_t, PtCalcCanvas() in the Photon Library Reference