Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcontainerhit.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcontainerhit.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcontainerhit.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcontainerhit.html on line 8

PtContainerHit()

Find the nth widget in an area

Synopsis:

PtWidget_t *PtContainerHit( PtWidget_t *container, 
                            unsigned n, 
                            PhRect_t const *rect );

Library:

ph

Description:

This function returns a pointer to the nth widget within the specified container that intersects with the rectangle provided in the PhRect_t structure pointed to by rect.

The coordinates of the rectangle are relative to the given container's canvas. If no widget intersects with rect, or if there are fewer than n intersections, 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 )
{
    PhRect_t   *rect;
    PtWidget_t *container;
    PtWidget_t *target_widget;

//  …
    rect = PhGetRects( cbinfo->event );
    container  =  PtFindContainer( widget );
    target_widget = PtContainerHit( container, 1, rect );
    if (target_widget)
       PtDestroyWidget( target_widget );
//  …
}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhGetRects(), PhRect_t, PtContainerBox()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcontainerhit.html on line 116

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcontainerhit.html on line 116