Date: Tue, 12 Dec 2000 10:38:56 +0100 To: Jacques Garrigue Cc: luther at dpt-info.u-strasbg.fr, lablgtk at kaba.or.jp Subject: Re: some lablgtk/lablGL questions ... Message-ID: <20001212103856.B25257 at lambda.u-strasbg.fr> References: <20001211163431.A15168 at lambda.u-strasbg.fr> <20001212104754R.garrigue at kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20001212104754R.garrigue at kurims.kyoto-u.ac.jp>; from garrigue at kurims.kyoto-u.ac.jp on Tue, Dec 12, 2000 at 10:47:54AM +0900 From: Sven LUTHER Sender: Sven LUTHER On Tue, Dec 12, 2000 at 10:47:54AM +0900, Jacques Garrigue wrote: > From: Sven LUTHER > > > I have been playing with lablgtk and lablgl this week end, and i have some > > difficulties with it (apart that i miss the easy setup stuff of mlgtk ...). > > > > (suredly once i will be able to read the docs, i will know how to do most of > > it, ...) > > There is a bit of confusion here. In fact the docs are not in the doc > directory :-) but only in the README file. > This is not very much, but this gives some explanation about how to > compile, and how the library is organized. > > (The famous .mgp file is slides for a presentation, that talks about > some design choices for lablgtk, but this is not very up-to-date anyway) Yes, i noticed it, i think the confusion comes from something i read somewhere, claiming that mlgtk was not documented, i thought it was in relation to lablgtk, but i realize now it is in relation to other graphic toolkit for ocaml. That said, how comes magicpoint 0.7a (latest stable, couln't compile the weekly snapshot) can't show the inlined ocaml code ? it appears in the postscript files whic are the result of mgp2ps. > For the easy setup, I do not understand very well. Usually you just > have to do > make configure USE_GL=1 > make > make install > and everything will be taken care of. No problem with the build system, i made debian package of them, so i only need to install them. and they have less dependencies than the other time i tried it some time ago : Package: lablgtk Status: install ok installed Priority: optional Section: devel Installed-Size: 7303 Maintainer: Sven LUTHER Version: 1.00.2000.11.29-2 Depends: ocaml (>= 3.00), lablgl, gtkglarea4, libc6 (>= 2.1.97), libgl1, libglib1.2 (>= 1.2.0), libgtk1.2 (>= 1.2.8-1), libncurses5, xlibs (>= 4.0.1-1) Description: Ocaml bindings to Gtk+ lablgtk is another set of bindings for gtk+ and ocaml. It includes support for gtkglarea and OpenGL bindings. Package: lablgl Status: install ok installed Priority: optional Section: devel Installed-Size: 1687 Maintainer: Sven LUTHER Version: 0.94-1 Depends: ocaml (>= 3.00), libc6 (>= 2.1.97), libgl1, libncurses5, tcl8.0 (>= 8.0.4), tk8.0 (>= 8.0.5), xlibs (>= 4.0.1-1) Description: an OpenGL interface for Objective Caml. LablGL is an OpenGL interface for Objective Caml. Since it includes support for the Togl widget, you can comfortably use it with LablTk. A GtkGlarea binding for use with lablgtk is also provided. It is only a quick packaging, no split packages or such. > > Also here are my questions/remarks : > > > > 1) How can i get the size back of a widget, in particular the draweable one > > (that is drawing area and GL area). I did a quick grep but didn't see any > > xxx_get_xxx kind of method to be used. > > On any widget, use widget#misc#allocation. Ok, this gets me a Gtk.rectangle. > > 2) I wanted to modify the drawing.ml example so as add some action to the > > button pressed callback. I added the callback all right, after some long > > source reading, but it didn't appear to have any effect. How do you set > > the event mask for it to be available. > > Use widget#event#add. Ok, ... > > 3) About lablGL. The example using only single buffering are not working, not > > under Togl (which give windows without content (you can see the stuff > > below it in the window stack)) and not under lablgtk (which stops with a > > Gpointer.Null exception, i tried to see what causes it, but it seems as > > spaguetti to me, and i was not able to identiify the source of the > > exception (well i wasn't able to identify any raise Null with grep in the > > source code :(((). > > You are talking about examples/GL/simple.ml? > I'm very surprised you should have any problem with it. > What version of OpenGL/Mesa are you using? Well, the Xfree 4.0.1g libgl version naturally, no DRI enabled though, so it should be the same as mesa, i think. The problem appears with simple.ml but also with checker.ml, scene.ml and simple.ml from the lablgl package. > > 4) The gtkgl widget comprise a GL context and a drawing area. Would it be > > usefull to be able to access to the drawingarea directly ? > > You can: gtkgl_area inherits from drawing area, so you can safely cast Ok, ... > to it (that is, get the raw widget, cast it, and wrap it again). > However I do not see any use for that, since everything useful is > already possible with the gtkgl_area. Don't know, was just thinking it could be usefull when i was not able to connect the button_press event to it. Anyway, more documentation could be usefull, maybe some commented .mli or something such ? or at least a quick explanation of where to search for what. Friendly, Sven Luther