From: Florent Monnier Organization: l'Association Linux-Nantes To: lablgtk at math.nagoya-u.ac.jp Subject: fun struct in GTK-tree ? Date: Wed, 10 May 2006 18:48:00 +0200 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200605101848.00829.fmonnier at linux-nantes.fr.eu.org> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" Content-Length: 815 Hi, I would like to know if it is possible (and how) to use a GTK-tree to represent a functional data structure ? For exemple this kind of data structure: type ('a, 'b) tree = | Leaf of 'a | Node of 'b * ('a, 'b) tree list I would like that every cell of the gtk-tree to represent one Node (or one Leaf) of the tree. And I would like that the user can modify the 'a data of each node, while the structure would stay functional. __________________________ Node('Z', [ Node('A', [ Leaf 3; Leaf 8; Leaf 2 ]); Leaf 4; Node('B', [ Leaf 5 ]); ]) For exemple I would like that the structure above would appear in the GUI like this: +-- Z +-- A | +-- 3 | +-- 8 | `-- 2 +-- 4 `-- B `-- 5 Is it possible ? -- thanks