From: Olivier Andrieu MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: <17698.45953.753908.389772 at karryall.dnsalias.org> Date: Tue, 3 Oct 2006 21:01:21 +0200 To: j.romildo at gmail.com Cc: caml-list at inria.fr, lablgtk at math.nagoya-u.ac.jp Subject: Re: missing gtk_button_set_image in lablgtk In-Reply-To: <20061003173755.GA28749 at malaquias.gwiceb1> References: <20061003133439.GA2593 at malaquias.gwiceb1> <20061003173755.GA28749@malaquias.gwiceb1> Content-Type: multipart/mixed; boundary="qJ8aG4Hald" Content-Length: 2199 --qJ8aG4Hald Content-Type: text/plain; charset=us-ascii Content-Description: message body and .signature Content-Transfer-Encoding: 7bit j.romildo@gmail.com [Tuesday 3 October 2006] : > > On Tue, Oct 03, 2006 at 10:34:39AM -0300, j.romildo@gmail.com wrote: > > Hello. > > > > I am using lablgtk to write the GUI for an application I am > > developing. Currently I want to set the image associated with a > > button, but it seems that lablgtk does not have support for the > > Gtk API function gtk_button_set_image. So I am writing to request > > this support in the next version of lablgtk. > > I have written the attached to add the methos image and set_image > to class Button of gtklabel. But I did not get the types correct > for the GtkWidget* from the Gtk+ API. Maybe someone has a clue on > how those methods should be typed. > > In Gtk+ the functions have the prototypes: > > GtkWidget* gtk_button_get_image (GtkButton *button); > > void gtk_button_set_image (GtkButton *button, GtkWidget *image); > > The idea is to have two new methods in the class button (files > gButton.mli and gButton.ml): > > image : option > > set_image : -> unit > > and two extern functions in module Button of file gtkButton.ml: No need to, since "image" is defined as a property. You just have to modify gtkButton.props and propcc will generate the code, and add the new methods in gButton.mli. Here is a patch, with a bunch of other missing properties of GtkButton. -- Olivier --qJ8aG4Hald Content-Type: text/plain Content-Disposition: attachment; filename="gtkbutton_missing_properties.patch" Content-Transfer-Encoding: 7bit Repository : andrieu@yquem.inria.fr:/net/yquem/devel/caml/repository Module : bazar-ocaml/lablgtk Working dir: ~/src/caml/lablgtk/lablgtk-camlcvs/ In directory .: In directory src: * Modified src/gButton.mli * Modified src/gtkButton.props --------------------- End --------------------- -- last cmd: cvs -f -z3 diff -u src/gtkButton.props src/gButton.mli -- --qJ8aG4Hald--