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/ptvalidparent.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/ptvalidparent.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/ptvalidparent.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/ptvalidparent.html on line 8
Identify a valid parent for the specified widget
PtWidget_t * PtValidParent(
PtWidget_t *widget_parent,
PtWidgetClassRef_t *class_ref );
ph
This function determines the real parent widget for widgets of type
class_ref, given that its parent is specified as
widget_parent when created or reparented.
Examples of a class_ref include PtWidget,
PtBasic, PtLabel, PtMeter,
and so on.
The real parent of a widget might not be the specified widget_parent
in special circumstances where the specified parent widget redirects the
child to an alternate parent.
Some examples:
- PtScrollArea redirects all widgets created as its
children or reparented to it to its virtual canvas (a container widget
within the scroll area).
- PtMenuBar redirects all widgets that aren't of type
PtMenuButton to the PtMenuBar's parent
(i.e. PtMenuBar accepts only PtMenuButton
widgets as its children).
A pointer to the widget that will be the real parent of any widgets of
type class_ref created in or reparented to widget_parent.
PtWidget_t *
MyRedirector( PtWidget_t *widget )
{
MyWidget_t *my = (MyWidget_t * ) widget;
PtWidget_t *parent;
if( ( parent =
PtValidParent( my->scroll_area,
widget->class_ref ) ) == widget )
return PtWidgetParent( widget );
return( parent );
/*
* Returning my->scroll_area would allow the child
* to be created as a direct child of my->scroll_area.
* This would be undesirable because scroll_area is a
* compound widget, which also needs to redirect its
* children to work correctly.
*/
}
Photon
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
PtFindGuardian(),
PtGetParent(),
PtGetParentWidget(),
PtReparentWidget(),
PtSetParentWidget(),
PtWidgetParent()
“Ordering widgets”
in the Managing Widgets in Application Code chapter of the
Photon Programmer's Guide
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/ptvalidparent.html on line 147
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/ptvalidparent.html on line 147