Date: Fri, 03 Feb 2006 19:24:11 +0900 (JST) Message-Id: <20060203.192411.15244515.garrigue at math.nagoya-u.ac.jp> To: sayan at crans.org Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: Drawing curves in a GPack.layout From: Jacques Garrigue In-Reply-To: <43E0BB69.9080509 at crans.org> References: <43E0BB69.9080509 at crans.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit From: "Sayan (Sébastien Li-Thiao-Té)" > However, I have had no success so far with drawing the edges of the > tree. Using a drawable area created from layout#misc#window does not > work, and the gtk2+ manual states: > "When handling expose events on a GtkLayout, you must draw to GTK_LAYOUT > (layout)->bin_window, rather than to GTK_WIDGET (layout)->window, as you > would for a drawing area." I see, bin_window is public but this was overlooked when wrapping the GtkLayout widget. Here is a patch to add a method layout#bin_window. Jacques Index: src/gPack.ml =================================================================== RCS file: /staff2/garrigue/repos/lablgtk/src/gPack.ml,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- src/gPack.ml 15 Nov 2004 14:30:38 -0000 1.36 +++ src/gPack.ml 3 Feb 2006 09:35:47 -0000 1.37 @@ -103,6 +103,7 @@ method hadjustment = new GData.adjustment (get Layout.P.hadjustment obj) method vadjustment = new GData.adjustment (get Layout.P.vadjustment obj) method freeze () = Layout.freeze obj + method bin_window = Layout.bin_window obj method thaw () = Layout.thaw obj method width = get Layout.P.width obj method height = get Layout.P.height obj Index: src/gPack.mli =================================================================== RCS file: /staff2/garrigue/repos/lablgtk/src/gPack.mli,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- src/gPack.mli 15 Nov 2004 14:30:38 -0000 1.36 +++ src/gPack.mli 3 Feb 2006 09:35:47 -0000 1.37 @@ -179,6 +179,7 @@ constraint 'a = [> Gtk.layout] val obj : 'a obj method event : event_ops + method bin_window : Gdk.window method freeze : unit -> unit method hadjustment : GData.adjustment method height : int Index: src/gtkPack.props =================================================================== RCS file: /staff2/garrigue/repos/lablgtk/src/gtkPack.props,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/gtkPack.props 15 Nov 2004 14:30:38 -0000 1.5 +++ src/gtkPack.props 3 Feb 2006 09:35:47 -0000 1.6 @@ -64,6 +64,7 @@ method move : "[>`widget] obj -> x:int -> y:int -> unit" method freeze method thaw + method bin_window : "Gdk.window" } conversions { Index: src/ml_gtkpack.c =================================================================== RCS file: /staff2/garrigue/repos/lablgtk/src/ml_gtkpack.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/ml_gtkpack.c 30 Jun 2005 09:10:00 -0000 1.10 +++ src/ml_gtkpack.c 3 Feb 2006 09:35:47 -0000 1.11 @@ -115,6 +115,7 @@ ML_4 (gtk_layout_move, GtkLayout_val, GtkWidget_val, Int_val, Int_val, Unit) ML_1 (gtk_layout_freeze, GtkLayout_val, Unit) ML_1 (gtk_layout_thaw, GtkLayout_val, Unit) +Make_Extractor(gtk_layout, GtkLayout_val, bin_window, Val_GdkWindow) /* gtknotebook.h */