Message-ID: <3F03DFD1.9070003 at lix.polytechnique.fr> Date: Thu, 03 Jul 2003 09:48:33 +0200 From: Benjamin Monate MIME-Version: 1.0 To: stalkern2 at tin.it Cc: lablgtk at kaba.or.jp Subject: Re: offscreen backing pixmap: C/gtk to ocaml/lablgtk translation? References: <200307030947.41209.stalkern2 at tin.it> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello, > /* Create a new backing pixmap of the appropriate size */ > static gint > configure_event (GtkWidget *widget, GdkEventConfigure *event) > { > if (pixmap) > /*(*-->a match for a option ref in Ocaml*)*/ > gdk_pixmap_unref(pixmap); > /*(*-->???*)*/ > > pixmap = gdk_pixmap_new(widget->window, > widget->allocation.width, > widget->allocation.height, > -1); > /*(*-->Gdk.Pixmap #create args*)*/ Do not worry about gdk_pixmap_unref. The OCaml Garbage collector will do this automatically. Just use something like : pixmap := Some (Gdk.Pixmap #create args ) Cheers, Benjamin