an easy one...ctree question
| From: | Rich Payne | Date: | Mon, 14 May 2001 15:22:18 +0000 |
| Subject: | an easy one...ctree question | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-1829@lists.php.net to get a copy of this message | ||
OK, so after my last problem this should be an easy one :)
Can anyone tell me what I'm doing wrong, the node_get_text fails on the
1st column, but return the correct value if I click on the same row, but
the 2nd column. (the error for the 1st
is:<b>Warning</b>: node_get_text() cannot get text value in
<b>test.php</b> on line <b>24</b>)
here's a code snippet:
function item_selected($tree,$nodeB,$col) {
$text=$tree->node_get_text($node,$col);
echo "Value is: ".$text." \n";
}
$win = &new GtkWindow();
$folder_tree = &new GtkCTree(2,0,array("Name","Total"));
$win->add($folder_tree);
$folder_tree->freeze();
$parent=$folder_tree->insert_node(null,null,array("Test1",""),5,null,null,null,null,false,true);
for ($i=0;$i<10;$i++)
{
$text=array($i,$i+10);
$sibling=$folder_tree->insert_node($parent,$sibling,$text,5,null,null,null,null,true,false);
}
$folder_tree->connect('tree_select_row',item_selected);
$folder_tree->thaw();
$win->show_all();
tia,
--rdp
--
Rich Payne
rpayne@alphalinux.org www.alphalinux.org