[Previous] [Contents] [Index] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

PtAttemptResize()

Adjust the size of a widget

Synopsis:

int PtAttemptResize( PtWidget_t *widget, 
                     PhRect_t const *canvas,
                     PhRect_t const *render );

Arguments:

widget
A pointer to the widget whose size you want to adjust.
canvas
A pointer to a PhRect_t structure (see the Photon Library Reference) that describes the widget's canvas.
render
A pointer to a PhRect_t structure that defines the part of the widget you want to render.

Description:

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.

Returns:

1
Successful completion.
0
No resize occurred.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtChildBoundingBox(), PtClipAdd(), PtClipRemove(), PtResizeCanvas()

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


[Previous] [Contents] [Index] [Next]