Delivered-To: garrigue at math.nagoya-u.ac.jp Delivered-To: lablgtk at yquem.inria.fr Date: Tue, 2 Dec 2008 13:40:33 +1100 From: Erik de Castro Lopo To: lablgtk at yquem.inria.fr Subject: Re: [Lablgtk] Gdk.cursor / Gtk.Window type error Message-Id: <20081202134033.a10d0566.mle+ocaml at mega-nerd.com> In-Reply-To: <20081202.111833.33962760.garrigue at math.nagoya-u.ac.jp> References: <20081202115407.abc82b31.mle+ocaml at mega-nerd.com> <20081202.111833.33962760.garrigue@math.nagoya-u.ac.jp> Organization: Erik Conspiracy Secret Labs Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: lablgtk at yquem.inria.fr Jacques GARRIGUE wrote: > You just forgot the parentheses around (win:Gdk.window) > Without them, this does not specify the type of win, but the return > type of the function. Hence the error. I think the lack of parentheses was actually a debugging artifact. When I add them I get a function with a signature of: val create_null_cursor : Gdk.window -> Gdk.cursor but then I run into trouble when I tried use it. If I replaced this working code: let cursor = Gdk.Cursor.create `PLUS in Gdk.Window.set_cursor win#misc#window cursor ; with: let cursor = create_null_cursor win in Gdk.Window.set_cursor win#misc#window cursor ; I got the following error: This expression has type GWindow.window but is here used with type Gdk.window = [ `drawable | `gdkwindow ] Gobject.obj Changing the above to this: let cursor = create_null_cursor win#misc#window in Gdk.Window.set_cursor win#misc#window cursor ; solved the problem. The fact that I don't use Ocaml's object system very often made this one a little difficult for me to debug. Thanks for your help Jacques. Cheers, Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- "Microsoft treats security vulnerabilities as public relations problems." -- Bruce Schneier _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk