GtkWidget::class_path

string class_path();

Returns the path of the widget through the packaging hierarchy, from the root parent to the widget itself. The single class names are separated by dots.

It is the same as path() , just that always the class names, not widget names are used.

Example 151. Getting a widget's path

<?php
//Create our widgets
$wnd   = new GtkWindow();
$box   = new GtkVBox();
$frame = new GtkFrame('Frame');
$btn   = new GtkButton('Button');

//Pack them into each other
$wnd  ->add($box);
$box  ->add($frame);
$frame->add($btn);

//Give some a custom name
$wnd->set_name('My window');
$btn->set_name('demo button');

//And now echo the class path of the button,
// and the normal path
echo 'class_path: "' . $btn->class_path() . "\"\n";
echo 'path:       "' . $btn->path() . "\"\n";

/* Returns:
class_path: "GtkWindow.GtkVBox.GtkFrame.GtkButton"
path:       "My window.GtkVBox.GtkFrame.demo button"
*/
?>

See also: path()