From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id CDCA5BC6B for ; Sat, 3 Nov 2007 05:17:16 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJOTK0fAXQImh2dsb2JhbACCc4t8AgEICik X-IronPort-AV: E=Sophos;i="4.21,365,1188770400"; d="scan'208";a="3983684" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 03 Nov 2007 05:17:16 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id lA34HF5Y000909 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sat, 3 Nov 2007 05:17:16 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAK6SK0dA6aa3mGdsb2JhbACCc4t8AgEBBwIGExg X-IronPort-AV: E=Sophos;i="4.21,365,1188770400"; d="scan'208";a="18888677" Received: from py-out-1112.google.com ([64.233.166.183]) by mail4-smtp-sop.national.inria.fr with ESMTP; 03 Nov 2007 05:17:13 +0100 Received: by py-out-1112.google.com with SMTP id u52so1895881pyb for ; Fri, 02 Nov 2007 21:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=uozKPbY16KfovCf+UpR104aStEcxVDL2n94ThhcvTjQ=; b=BmG8xYXC/Ifr8eQEDoEJF8bXSKpcZll5xogZF697pAr9t3T4wOi9Boxgj9kQSj8qgPrX7u8zenOvzhx8tN1JUzMHJkflLXwacjbkzKxVfvc8ie8DB18NNxnZ1EK7Dt91JldD34MUvnY+/I4Lnaot2JP1LwdEZF7gNRZmxVxyeFE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=jJd+gUD3b5Gtvjov7Dm69aIr3P3dKz71KcrHWDUGjdaRfQqFvrMRxrNNdNHm5EKzu2a4JCFoK2b1SsdQYBw93kcshT2xrkG/+nFgSSRcIyQJ25BHEcGsRyhUBS/LeoLjTYlyoUULrMFCyfoV73IzhBBobfahvWfNUKvjno79ESY= Received: by 10.35.121.12 with SMTP id y12mr2906176pym.1194063432697; Fri, 02 Nov 2007 21:17:12 -0700 (PDT) Received: by 10.35.89.3 with HTTP; Fri, 2 Nov 2007 21:17:12 -0700 (PDT) Message-ID: Date: Fri, 2 Nov 2007 23:17:12 -0500 From: "Angela Zhu" To: "Julien Moutinho" , caml-list@inria.fr Subject: Re: [Caml-list] problem with gbutton In-Reply-To: <20071103040241.GA26778@localhost> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_21909_8784920.1194063432694" References: <20071102234738.GA7257@localhost> <20071103040241.GA26778@localhost> X-Miltered: at discorde with ID 472BF64C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; gbutton:01 gmain:01 bool:01 gmain:01 bool:01 lablgtk:01 lablgtk:01 angela:98 angela:98 22.:98 W6:98 W6:98 wrote:01 wrote:01 caml-list:01 ------=_Part_21909_8784920.1194063432694 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline It works. Thanks! -Angela On 11/2/07, Julien Moutinho wrote: > > 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. > > -- Regards, Angela Zhu ------------------------------------------ Dept. of CS, Rice University http://www.cs.rice.edu/~yz2/ ------------------------------------------ ------=_Part_21909_8784920.1194063432694 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline It works.
Thanks!

-Angela

On 11/2/07, Julien Moutinho <julien.moutinho@gmail.com> wrote:
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.




--
Regards,
Angela Zhu
------------------------------------------
Dept. of CS, Rice University
http://www.cs.rice.edu/~yz2/
------------------------------------------ ------=_Part_21909_8784920.1194063432694--