From: Julien Moutinho <julien.moutinho@gmail.com>
To: Angela Zhu <angela22.zhu@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] problem with gbutton
Date: Sat, 3 Nov 2007 05:02:41 +0100 [thread overview]
Message-ID: <20071103040241.GA26778@localhost> (raw)
In-Reply-To: <f82e818a0711022020r36363925nba61dac4e4dadd87@mail.gmail.com>
On Fri, Nov 02, 2007 at 10:20:24PM -0500, Angela Zhu wrote:
> I also want to add
>
> GMain.Idle.add ~callback:(fun () -> true);
>
> But I keep getting:
>
> ***********
> Expecting function has type ?prio:int -> (unit -> bool) -> Glib.Idle.id
> This argument cannot be applied with label ~callback
>
> Any idea?
As said by the error message, the signature of GMain.Idle.add is:
?prio:int -> (* an optional argument: the priority *)
(unit -> bool) -> (* an anonymous argument: the callback *)
Glib.Idle.id (* the returned value: an identifier *)
Here no argument of GMain.Idle.add has a label named "callback",
hence the error you get.
Instead do the following:
let id = GMain.Idle.add (fun _ -> true) in
Also, there is a manual chapter on labels:
http://caml.inria.fr/pub/docs/manual-ocaml/manual006.html
And by the way, do not forget that there is a mailing list
dedicated to LablGTK:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk
HTH.
next prev parent reply other threads:[~2007-11-03 4:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-02 22:48 Angela Zhu
2007-11-02 23:47 ` [Caml-list] " Julien Moutinho
2007-11-03 3:20 ` Angela Zhu
2007-11-03 4:02 ` Julien Moutinho [this message]
2007-11-03 4:17 ` Angela Zhu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071103040241.GA26778@localhost \
--to=julien.moutinho@gmail.com \
--cc=angela22.zhu@gmail.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox