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

PtContainerBox()

Find the next widget in an area

Synopsis:

PtWidget_t * PtContainerBox( PtWidget_t *container,
                             PtWidget_t *start,
                             PhRect_t const *rect );

Description:

This function returns a pointer to the first widget within the specified container that intersects with the provided rectangle.

The widget identified by start tells the function where to start looking for intersections. First, the function checks start's brother behind. Then, it then checks the brother behind that, and so on.

Returns:

If no widget after start intersects with rect or if the provided container pointer doesn't actually point to a container, the function returns NULL.

Examples:

PtWidget_t *target_widget, *my_pane;
...

// In my_pane's RAW callback:
my_raw_cb( PtWidget_t *container, void *data, 
           PtCallbackInfo_t *cbinfo )
{
    ...
    rect = PhGetRects( cbinfo->event );
    if( target_widget = PtContainerBox( widget, 
           PtWidgetChildFront( container ) , &rect ) )
           PtDestroyWidget( target_widget );
    ...

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhGetRects(), PtContainerHit(), PtWidgetChildFront()


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