Gdk.cursor / Gtk.Window type error

Erik de Castro Lopo <[email protected]>
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Organization Erik Conspiracy Secret Labs
Message-ID <[email protected]>
Hi all,

I am trying to temporarily hide the mouse cursor and for that I 
need a transparent cursor object which I'm trying to create as
follows:

    let create_null_cursor win:Gdk.window =
        let w, h = 10, 10 in
        let mask = Gdk.Bitmap.create ~window:win ~width:w ~height:h () in
        let pixmap = Gdk.Pixmap.create ~window:win ~width:w ~height:h ~depth:1 () in
        let color = Gdk.Color.alloc (Gdk.Color.get_system_colormap ()) (`RGB (255, 0, 0)) in
        Gdk.Cursor.create_from_pixmap pixmap mask color color w h

but that fails to compile with the following error message:

    This expression has type Gdk.cursor but is here used with type
      Gdk.window = [ `drawable | `gdkwindow ] Gobject.obj

My experimentation so far seems to suggest that the type of the win
parameter is not fully known, but I'm not sure how to make the compiler
happy about this.

Anyone have any clues about this?

Cheers,
Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
Rule 1: Spammers lie.
Rule 2: If a spammer seems to be telling the truth, see Rule #1.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.