[prev in list] [next in list] [prev in thread] [next in thread]
List: php-gtk-general
Subject: Re: [PHP-GTK] trees and paths
From: Benjamin Smith <bens () effortlessis ! com>
Date: 2003-12-23 0:00:46
[Download RAW message or body]
Dimitri,
Well, I'm going thru my email-list archives, and it might be a bit late, but
I've used $ctree->Node_Set_Row_Data() for a similar function to good
success...
http://gtk.php.net/manual/en/gtk.gtkctree.method.node_set_row_data.php
Combine this with the children() function on
http://gtk.php.net/manual/en/gtk.gtkctree.method.post_recursive.php
and you have a mechanism for dealing with ctree without storing anything in a
fancy hash or anything.
I then call a recursive function defined something like
Function GetStuff($ctree, $node=null, $return='')
as in
<?
$data=GetStuff($ctree);
?>
I use various means to actually SAVE the data in the $data variable, so I
don't give the whole function.
However, I've used
$data[name]=$NameOfMemVariable;
$data[data]=$ArrayOfData;
$ctree->Node_Set_Row_Data($data);
I hope this, along with the Print_Display() function I noted on
http://gtk.php.net/manual/en/gtk.gtkctree.php
proves to be helpful!
-Ben
On Tuesday 16 December 2003 01:04 am, Dimitri Giardina wrote:
> another hint
>
> i'm writing a xml editor in php, using a ctree, a table for xml-node
> attributes and a gtktext for cdata into nodes. for parse a xml file i'm
> using xml_parser functions.
> xml nodes are not labeled (i have no id for a node), and making path from
> node types have not sense, i thought the better thing was:
>
> $obj=&$this->tree->insert_node($parent,Null,array($key),3,Null,Null,Null,Nu
>ll,False,True); $this->key="KEY_".(++$this->datacounter);
> $this->tree->set_data(serialize($obj),$this->key);
>
> the set_data is a access function (for all widgets) to a hash table.
>
> i think it's very useful, but it's very little documented.
>
> Dimitri Giardina
--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic