Date: Wed, 26 May 2004 17:27:09 +0900 (JST) Message-Id: <20040526.172709.07272526.garrigue at kurims.kyoto-u.ac.jp> To: frido at q-software-solutions.de Cc: lablgtk at kaba.or.jp Subject: Re: filling data in glade-2 generated code From: Jacques GARRIGUE In-Reply-To: <871xl74rpw.fsf at fbigm.here> References: <871xl74rpw.fsf at fbigm.here> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Friedrich Dominicus > I first have written the gui-layout by hand which kind of works but > which I simply to not like all too much. Then I found that glade > should be usable with lablgtk2. I studied the examples, and wanted to > write my stuff like that. this is the generated code for the dialog: [...] > Very nice indeed ;-) > > Now my question how am I able to fill the view with data? here are > some of those: > > > let currencies = > ["Afghanistan Afghani . AFA"; > "Albanian Lek . ALL"; > "Algerian Dinar . DZD"; > "Andorran Franc . ADF" ];; > > > This data should be put into the listbox. I assume that i have to use > store_of_list from proper. But I did not get the right types for > it. So could anyone give me a hand please. Note that store of list will only provide you with a single column list. If this is enough for you, then you just have to do let w1 = new window1 () let (store, column) = GTree.store_of_list Gobject.Data.string currencies let () = w1#to_cur#set_model (Some(store :> GTree.model)); w1#to_cur#append_column column; w1#from_cur#set_model (Some(store :> GTree.model)); w1#from_cur#append_column column; ... I'm not sre you can share the column data structure, you may have to create a new one. Also I didn't check that it works, as you didn't send the .glade file, which is the really needed one. Jacques