Message-ID: <44C34528.1050307 at rftp.com> Date: Sun, 23 Jul 2006 02:45:12 -0700 From: Robert Roessler Organization: Robert's High-performance Software MIME-Version: 1.0 To: LablGTK List Subject: GTK 2.8[.18] and other questions Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Length: 2512 I have done a source build of LablGTK (CVS from July 6) using GTK 2.8.18 includes and libraries (on WinXP SP2)... while there were no apparent build problems, and my few apps seem to run fine when paired with the 2.8.18 runtime, is this generally a *bad idea*? Or because of the way the GTK/GLib compatibility requirements work, this should be fine (as long as I am not looking for / depending on any 2.8 new features)? I have a few non-widget memory management questions (regarding GtkAdjustment specifically, but any generally applicable observations would be welcomed): 1) I have created a new "GtkAdjustment" in OCaml using (e.g.) GData.adjustment ~upper:678. () 2) So I now have a new OCaml wrapper object wrapping a GTK reference counted object - specifically a GtkAdjustment, correct? 3) If I want to extract a pointer to the GTK object and pass it in C code to a widget, it seems I should use GData.as_adjustment to obtain the value to pass down to the C external function, but what should it do with it? Does GtkAdjustment_val() provide the correct handling/ casting of the parameter so that I can then pass that to the widget? 4) Now I want to ask the widget for the GtkAdjustment back... note that I expect it to hand me the same pointer that I materialized in 3) above (in my specific widget's case). 4a) Precisely what should the C-level wrapper code do with the GtkAdjustment pointer that the widget returns? 4b) Precisely what should the OCaml code calling the external C wrapper function be expecting back and what should it do with it to [re-]bind it to an OCaml "adjustment" object? 4c) Is it important that it be bound to a "canonical" OCaml "adjustment" object IF one is still "live", or can many OCaml objects bind to the SAME GTK [non-widget] object, and everything still works out because of some reference-counting behind the scenes magic? I note that while there seems to be a fair amount of support infrastructure for OCaml handling of "adjustment" objects, I am not using much of it... so I wonder if this is because I am not working with the problems it is intended to solve for me, or is it all actually essential and I am missing out on its coolness? Put a different way, while one can discern a lot from module and function signatures and type information, *intent* is not always so easy to divine this way... ;) Thanks for any clarifications / shedding of light / imparting of wisdom. Robert Roessler robertr@rftp.com http://www.rftp.com