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

PtDamageWidget()

Mark a widget as damaged so it will be redrawn

Synopsis:

int PtDamageWidget( PtWidget_t *widget );

Description:

This function adds the specified widget's extent to the damage list of the widget's first window parent. This effectively marks the widget as being damaged so that it will be redrawn.

The widget library takes care of updating widgets whenever resources are modified. So you don't normally use this function unless you're mixing Pg*() calls with widget calls, and want a widget to redraw and repair itself directly.

Returns:

0
Successful completion.
-1
An error occurred.

Examples:

int mycallback( PtWidget_t *widget, void *data, 
                PtCallbackInfo_t *cbinfo )

{
    PgGC_t      *wgtlib_gc;

    /* my_context is global */
    wgtlib_gc = PgSetGC( &my_context ); 

    /* draw objects on top of the widget */
    Pgxxx... calls

    /* restore the widget library's GC */
    PgSetGC( wgtlib_gc );

    /* mark the widget as damaged so that it will 
       be redrawn */
    PtDamageWidget( widget );

    return( Pt_CONTINUE );
}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtDamageExtent()


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