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.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 496B5BC6B for ; Sat, 3 Nov 2007 05:01:48 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKeOK0fAXQImh2dsb2JhbACOagIBCAop X-IronPort-AV: E=Sophos;i="4.21,365,1188770400"; d="scan'208";a="18888505" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 03 Nov 2007 05:01:47 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id lA341lUm000663 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sat, 3 Nov 2007 05:01:47 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAFqPK0dIDtbrhmdsb2JhbACOagIBCAQEERMF X-IronPort-AV: E=Sophos;i="4.21,365,1188770400"; d="scan'208";a="5401305" Received: from hu-out-0506.google.com ([72.14.214.235]) by mail3-smtp-sop.national.inria.fr with ESMTP; 03 Nov 2007 05:01:46 +0100 Received: by hu-out-0506.google.com with SMTP id 16so422768hue for ; Fri, 02 Nov 2007 21:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:date:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; bh=WZy3CgiNIqlPgJ1lZ2Xv6TyGvDlKRoh/ageIkP0K4h4=; b=PUQ45+4Nge6o/vLTtNvMA5Bgdq3unXLtK3KvF4t8eTB+7wTm7q4agv2Ri2gBW/5SbdljrM+5qKr7CI4KZI8Xws3vdQJvzywgg/7oQ+lttaVMsg0EtSEjiaziWUNlGc6yB1XLNGa2eGeEtHuwLqEdMHkqM6+kfsF7/sVZlekPCro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=FOAgP12NZ55NLnt3jCxeuUOeZN2Tp718LHu9FXxZiszg83GjAWQXge4gyzaNcSq39t+xhrnb1bTdE1aCLAuMASv2G6OovzUPTx0vV7Uq+Lk9nav3tCvb7M7uGk+giQkWhXDXlPyxZMJ4iZrTk+57Uf2C8UWhnZssvlEgEdsPCf4= Received: by 10.86.1.1 with SMTP id 1mr1372681fga.1194062506001; Fri, 02 Nov 2007 21:01:46 -0700 (PDT) Received: from localhost ( [83.201.31.218]) by mx.google.com with ESMTPS id 34sm4712972nfu.2007.11.02.21.01.42 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2007 21:01:44 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Sat, 03 Nov 2007 05:02:41 +0100 Date: Sat, 3 Nov 2007 05:02:41 +0100 To: Angela Zhu Cc: caml-list@inria.fr Subject: Re: [Caml-list] problem with gbutton Message-ID: <20071103040241.GA26778@localhost> Mail-Followup-To: Julien Moutinho , Angela Zhu , caml-list@inria.fr References: <20071102234738.GA7257@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) From: Julien Moutinho X-Miltered: at discorde with ID 472BF2AB.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 wrote:01 caml-list:01 int:01 int:01 callback:02 callback:02 caml:02 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.