To: Olivier Andrieu Cc: Christoph Bauer , lablgtk at kaba.or.jp Subject: Re: Lablgtk under windows References: <000a01c41100$1959bc40$c64efea9 at Pc1> <20040324073520N.garrigue@kurims.kyoto-u.ac.jp> <16481.46955.27649.776507@karryall.dnsalias.org> From: Christoph Bauer Date: Wed, 24 Mar 2004 21:08:57 +0100 In-Reply-To: <16481.46955.27649.776507 at karryall.dnsalias.org> (Olivier Andrieu's message of "Wed, 24 Mar 2004 17:29:31 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hi, > > BTW, I'm a bit disappointed about the complexity of the GTree > > API. It is hard to create a simple list. > > It's not *that* hard. Anyway, that's not really LablGTK's fault, the > GTK+ API is like this. > > In the latest snapshost there's a convenience function in GTree for > creating "simple" list (ie a model with only one column). > > val store_of_list : > 'a Gobject.data_conv -> 'a list -> > list_store * 'a column > > let store_of_list conv data = > let cols = new column_list in > let column = cols#add conv in > let store = list_store cols in > List.iter > (fun d -> > let row = store#append () in > store#set ~row ~column d) > data ; > store, column This is what I mean ;-) Compare this code with the Tcl/Tk equivalent pack [listbox .lb -listvar l] Ok, `listbox' can only have one column, but it is quite easy to use several listboxes packed in a horizontal row together. I have another tree related question. My application shows a list of files on a remote machine. Some files are cached. It would be nice when this files (= rows of my list) can be displayed in a special color, e.g. with a green background color. With Tk I could do a .lb itemconfigure -background green Thanks in advance. Christoph Bauer -- beginfig(1)u=3cm;draw fullcircle scaled 2u;x0=x1=y1=x2=y3=0;-y0=y2=x3=1u; filldraw z0..{left}z1{left}..z2{curl 1}..z3..z0..cycle;def t(expr p)=fullcircle scaled .25u shifted(0,p*u);enddef;unfill t(.5);fill t(-.5);endfig;bye