Trees
| From: | Andrew Smith | Date: | Fri, 07 Mar 2003 10:01:22 +0000 |
| Subject: | Trees | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3075@lists.php.net to get a copy of this message | ||
Hi
GtkTree is quite limited, lacking features like indenting, recursive
deselecting etc... (unless someone can help me implement those?).
GtkCTree is far more powerful, but I have still not been able to handle one
major shortfall - I can't seem to assign data to a tree node. For example:
<?php
if (!class_exists('gtk')) {
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
dl('php_gtk.dll');
else
dl('php_gtk.so');
}
$window = &new GtkWindow();
$window->connect_object('destroy', array('gtk', 'main_quit'));
$window->connect('delete-event', 'delete_event');
function delete_event() {
return false;
}
$window->show();
$ctree = &new GtkCTree(1, 0, array('Tree'));
$window->add($ctree);
$ctree->show();
$node=$ctree->insert_node(null, null, array("Top Tree"),5, null, null,
null,null, false,false);
$node->set_data("id",99);
Gtk::main();
?>
I get:
Fatal error: Call to undefined function: set_data() in C:\gtk\ctree.php on
line 24
I need to assign data to that node, so that later when someone clicks on the
node I can identify which item they have clicked on.
Any suggestions?
Thanks!
--------------------------------------
Andrew Smith
The Blue Box Cape Town
http://www.bluebox.co.za
andrew@bluebox.co.za
021 683 6017 / 083 659 6106