Date: Thu, 26 Aug 2004 22:25:42 -0500 From: Michael Halcrow To: Olivier Andrieu Cc: lablgtk at kaba.or.jp Subject: Re: Combo entry_completion? Message-ID: <20040827032542.GA4244 at halcrow.us> Reply-To: Michael Halcrow References: <20040819152938.GA6894 at halcrow.us> <20040820.145324.41627916.andrieu at ijm.jussieu.fr> <20040826004336.GB22131 at halcrow.us> <20040826.204051.74729746.oandrieu at nerim.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <20040826.204051.74729746.oandrieu at nerim.net> Sender: Michael Halcrow --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 26, 2004 at 08:40:51PM +0200, Olivier Andrieu wrote: > Michael Halcrow [Wed, 25 Aug 2004]: > > > To use completion with a combo box entry, it goes somehow like this: > > >=20 > > > ,---- > > > | let make_combo_box_entry_with_completion packing strings =3D > > > | let (combo, (model, column)) =3D GEdit.combo_box_entry_text ~str= ings ~packing () in > > > | let entry =3D combo#entry in > > > | let completion =3D GEdit.entry_completion ~model ~entry () in > > > | completion#set_text_column column ; > > > | (combo, entry, completion) > > > `---- > >=20 > > That worked wonderfully. But I also need to be able to dynamically > > replace the contents of the list. With the old combo box, that's just > > a matter of manipulating combo#list. It isn't immediately obvious to > > me how to go about doing the same on the combo w/ entry completion. >=20 > well it's about the same, you modify the model (cf GtkListStore > API). For instance to add an element: >=20 > model#set ~row:model#append ~column data So data is of type 'a GTree.column, which is defined: type 'a column =3D {index: int; conv: 'a data_conv; creator: int} I can guess what index is, but creator? And data_conv? type 'a data_conv =3D { kind : data_kind; proj : data_conv_get -> 'a; inj : 'a -> unit data_set } Okay, at this point I feel like I'm on a wild goose chase. My instinct tells me that I should not be having to follow everything down to their primitives just to construct ``data.'' I just want to tack a new string onto the list. Forgive me if this is supposed to be obvious, but could you give me a simple example of how to (1) clear the list and (2) append a string onto this list? Or maybe just some good background reading material? :-) Thanks again, Mike --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBLqm2LTz92j62YB0RAvPKAKCZWQBQH0prj6lLCMwmNLQVVcjp3gCcDLqn GN40rFig8W33CG1RkcFu/j4= =Wed7 -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0--