[Lablgtk] Gdk.cursor / Gtk.Window type error

Erik de Castro Lopo mle+ocaml at mega-nerd.com
Tue Dec 2 01:54:07 CET 2008


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.

_______________________________________________
Lablgtk mailing list
Lablgtk at yquem.inria.fr
http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk



More information about the Lablgtk-list mailing list