PHP-GTK
Friday, July 25, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkWidget::modify_text
GtkWidget::pop_colormapnext

Last updated: Sun, 12 May 2013
view this page in English

GtkWidget::path

Obtains the full path to the widget. The path is simply the name of a widget and all its parents in the container hierarchy, separated by periods. The name of a widget comes from get_name() . Paths are used to apply styles to a widget in gtkrc configuration files. Widget names are the type of the widget by default (e.g. "GtkButton") or can be set to an application-specific value with set_name() . By setting the name of a widget, you allow users or theme authors to apply styles to that specific widget in their gtkrc file.

Example 153. 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()


User Contributed Notes
gtk.gtkwidget.method.path.php
add a note about notes
There are no user contributed notes for this page.


previousGtkWidget::modify_text
GtkWidget::pop_colormapnext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:51:01 2013 CEST