From: Olivier Andrieu MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: <17478.50853.459149.712593 at karryall.dnsalias.org> Date: Thu, 20 Apr 2006 01:24:21 +0200 To: Erik de Castro Lopo , Robert Roessler Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: Low level lablgtk2 hacking In-Reply-To: <20060420060312.67f8a4ee.ocaml-erikd at mega-nerd.com> References: <20060420060312.67f8a4ee.ocaml-erikd at mega-nerd.com> <4446BCBB.2050502@rftp.com> Content-Type: text/plain; charset=us-ascii Content-Length: 1720 Erik de Castro Lopo [Thursday 20 April 2006] : > > Hi all, > > Is there some way to access GTK+/C functionality from Ocaml? > > For instance I would like to be able to call the GTK+/C function > gtk_scrolled_window_set_policy() for a lablgtk2 scrolled_window > object. Unfortunately, the lablgtk2 scrolled_window class does > not seem to expose this functionality. I see #set_hpolicy and #set_vpolicy methods in the GBin.scrolled_window class. > I actually have a number of problems of this type. Is there a > general solution? It depends : - sometimes it's just that a high-level lablgtk class is missing something but the lower-level layer wraps it. You can usually arrange to call the low-level function directly. - if the missing functionality is a property or a signal, you can (almost) always dynamically use it with the functions of the module Gobject - if the missing functionality is only available via a C function, then some C code is needed. Robert Roessler [Wednesday 19 April 2006] : > Actually, I *am* puzzled - the 2.6.0 release of LablGTK has the > following in ml_gtkbin.c: > > ML_3 (gtk_scrolled_window_set_policy, GtkScrolledWindow_val, > Policy_type_val, Policy_type_val, Unit) > > but I *think* that the only interface exposed is the ability to > independently set the "h" and "v" policies for a "GtkScrolledWindow". > > So either I am not getting the intent of the LablGTK interface/code, > or this part of LablGTK is as yet unfinished. That's because the class is using the properties "hscrollbar-policy" and "vscrollbar-policy" of GtkScrolledWindow directly. Wrapping gtk_scrolled_window_set_policy isn't really needed. -- Olivier