PtSuperClassExtent()

Invoke the Extent method of the specified superclass

Synopsis:

void PtSuperClassExtent( PtWidgetClassRef_t *wc_ref,
                         PtWidget_t *widget );

Arguments:

wc_ref
The superclass whose method you want to invoke.
widget
A pointer to the widget for which to invoke the method.

Description:

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.

Examples:

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 );

}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No