Re: Gdk.cursor / Gtk.Window type error
Jacques GARRIGUE <[email protected]>
| Newsgroups | gmane.comp.lang.ocaml.lib.gtk |
|---|---|
| Message-ID | <[email protected]> |
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. Cheers, Jacques From: Erik de Castro Lopo <[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. > > _______________________________________________ > Lablgtk mailing list > [email protected] > http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk