Date: Wed, 20 Dec 2000 09:13:19 +0100 To: Jacques Garrigue Cc: luther at dpt-info.u-strasbg.fr, lablgtk at kaba.or.jp Subject: Re: file_selection_complete patch. Message-ID: <20001220091319.B2330 at lambda.u-strasbg.fr> References: <20001211163431.A15168 at lambda.u-strasbg.fr> <20001212104754R.garrigue at kurims.kyoto-u.ac.jp> <20001218132340.A29055 at lambda.u-strasbg.fr> <20001220125012A.garrigue at kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20001220125012A.garrigue at kurims.kyoto-u.ac.jp>; from garrigue at kurims.kyoto-u.ac.jp on Wed, Dec 20, 2000 at 12:50:12PM +0900 From: Sven LUTHER Sender: Sven LUTHER On Wed, Dec 20, 2000 at 12:50:12PM +0900, Jacques Garrigue wrote: > From: Sven LUTHER > > > I noticed the file_selection widget lacked support for the complete function, > > so i added it and am sending you here the corresponding patch. I hope it is > > ok especially as regarding the file_selection constructor, as i am not that > > familiar with the labels and optional argument. > > Thanks for noticing this lacking function. > I often realize that this is not so much a pain to have to write the stub > by hand (anyway you need to read the docs to do something nice), but > that checking that you forgot nothing is really hard. Particularly > when the library itself is also evoluting... I understand that, we had the same problem with mlgtk. Automatic or semi-automatic translation (or at least stub skeleton writing) is the way to go for this. Also gtk+ 2.0 seems to be coming, altough i don't know the release date previsions for it. > > How do you program it so that if the filter optional argument is present, you > > call the complete method with it, or otherwise you don't do anything (maybe > > some of the may stuff i saw all over the place ?) > > Indeed, this is what may does, which is just equivalent to > let f ?opt () = > begin match opt with None -> () > | Some x -> set_opt x > end; > ... > If you were to include this, you would probably add it to > Fileselection.set. iYes, i did find the code for it later on, the complete patch was really just a quick fix. Ideally, i would have done something like : ... may filter (function () -> w#complete filter); ... or something such instead of the ... w#complete filter; ... i wrote there right now, what do you think ? (maybe you could do the change, directly, i think it is almost as much/less work as applying the patch). > But here, complete is not simply a filter, but is rather intended to be > called for completing a partial input, like when you press tab. Erm, ... i don't understand you here, when i pass "*.ml" to complete, then only the .ml files of the given directory are shown ? Is this not how a filter does behave ? > So I removed the constructor part of your code. :(((( > So bad there is no real concept of filter in GTK's file selector. > The one Jun made for labltk had one, and this is really nice. I still don't understand the difference, but then if there trully is one, maybe be we should send a request for it to the gtk+ guys ? Friendly, Sven Luther