PtWidgetPreferredSize()

Retrieve the preferred size of a widget

Synopsis:

PhDim_t *PtWidgetPreferredSize(
            PtWidget_t const *widget,
            PhDim_t *dim );

Library:

ph

Description:

This function retrieves the optimal size of a widget, which is recorded whenever the widget calls PtResizeCanvas() or PtAttemptResize() while calculating its extent (see Building Custom Widgets).

The preferred size is the size the widget would be if Pt_RESIZE_XY_ALWAYS were set in its Pt_ARG_RESIZE_FLAGS. The preferred size is never any smaller than the widget's minimum size. The resulting dimension is stored in the PhDim_t structure pointed to by dim.

Returns:

A pointer to the PhDim_t structure that was passed in.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhDim_t, PtWidgetMinimumSize()

PtAttemptResize(), PtResizeCanvas() in Building Custom Widgets