Date: Fri, 2 May 2003 14:04:42 +0100 To: lablgtk at kaba.or.jp Subject: GtkHtml bindings for OCaml - some help required Message-ID: <20030502130442.GA24136 at redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline From: Richard Jones So I'm getting some way along with these bindings, but it's still segfaulting. The GtkHTML widget itself is derived from a GtkLayout. I can't find any other widgets in gtk which are derived from this parent class, so I have no pattern to copy code from. So far I've written a gtkHtml.ml file: open Gtk type html = [widget|`layout|`html] external create : unit -> html obj = "ml_gtk_html_new" and a corresponding ml_gtkhtml.c file, of course. And my high-level wrapper has been added to the end of gHtml.ml: // .. contents of gHtml.ml followed by: open GtkHtml class html obj = object (self) inherit widget_full (obj : GtkHtml.html obj) end let html ?packing ?show () = let w = create () in pack_return (new html w) ~packing ~show This compiles, but my test program segfaults. On further inspection it turns out that the C widget structure appears to be completely uninitialized, which is what causes the segfault. However, from warning messages which are printed, I have every reason to believe that gtk_html_new() is being called. (Although I can't set a gdb breakpoint to absolutely positively prove this). Any ideas what I'm doing wrong? Rich. -- Richard Jones, Red Hat Inc. (London) and Merjis Ltd. http://www.merjis.com/ http://www.annexia.org/ Freshmeat projects: http://freshmeat.net/users/rwmj MAKE+ is a sane replacement for GNU autoconf/automake. One script compiles, RPMs, pkgs etc. Linux, BSD, Solaris. http://www.annexia.org/freeware/makeplus/