Re: an easy one...ctree question

From: Date: Mon, 14 May 2001 17:10:53 +0000
Subject: Re: an easy one...ctree question
References: 1  Groups: php.gtk 
Request: Send a blank email to php-gtk+get-1836@lists.php.net to get a copy of this message
I'm sure I suffer from foot-in-mouth disease most days lately :( ----- Original Message ----- From: "Rich Payne" <rdp@talisman.alphalinux.org> To: "Steph" <steph.fox@btinternet.com> Cc: <php-gtk@lists.php.net> Sent: Monday, May 14, 2001 6:06 PM Subject: Re: [PHP-GTK] an easy one...ctree question On Mon, 14 May 2001, Steph wrote: > Rich, hi - > > You've defined $sibling using $sibling, won't that hurt it? Honestly....I don't know. I stole that bit of code from the gtk.php example included in php.gtk. I originally had it as NULL, but it seems to make little difference (at least in my case). > (Is this a brand new form of sibling rivalry?) :) --rdp > > ----- Original Message ----- > From: "Rich Payne" <rdp@talisman.alphalinux.org> > To: <php-gtk@lists.php.net> > Sent: Monday, May 14, 2001 4:22 PM > Subject: [PHP-GTK] an easy one...ctree question > > > > 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

« previous php.gtk (#1836) next »