Date: Sat, 22 Apr 2006 21:19:55 +0900 (JST) Message-Id: <20060422.211955.71882695.garrigue at math.nagoya-u.ac.jp> To: ocaml-erikd at mega-nerd.com Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: Setting the cursor in a text_view object From: Jacques Garrigue In-Reply-To: <20060422191222.64fba4d7.ocaml-erikd at mega-nerd.com> References: <20060421134912.5de86566.ocaml-erikd at mega-nerd.com> <20060422190527.094d0aa6.erikd@mega-nerd.com> <20060422191222.64fba4d7.ocaml-erikd@mega-nerd.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: Text/Plain; charset=us-ascii Content-Length: 802 From: Erik de Castro Lopo > > Gdk.Window.set_cursor tview#misc#window (Gdk.Cursor.create `LEFT_PTR) ; > > I suspect that the above line should actually be something like: > > Gdk.Window.set_cursor (tview#get_window `TEXT) (Gdk.Cursor.create `LEFT_PTR) ; > > but this does compile due to the following error: > > This expression has type Gdk.window option but is here used with type > Gdk.window = [ `drawable | `gdkwindow ] Gobject.obj > > and I'm not sure how to fix this. The OO aspects of Ocaml are still > a little unclear to me. Classical encoding of potentially null pointer. So you just have to do let tw = match tview#get_window `TEXT with Some w -> w |None -> assert false in Gdk.Window.set_cursor tw (Gdk.Cursor.create `LEFT_PTR) Jacques