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 68C1BBC6B for ; Sat, 3 Nov 2007 00:46:46 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAFpTK0dIDtbti2dsb2JhbACOagIBCAQEJAWBEQ X-IronPort-AV: E=Sophos;i="4.21,364,1188770400"; d="scan'208";a="18885428" Received: from hu-out-0506.google.com ([72.14.214.237]) by mail4-smtp-sop.national.inria.fr with ESMTP; 03 Nov 2007 00:46:45 +0100 Received: by hu-out-0506.google.com with SMTP id 40so403438hub for ; Fri, 02 Nov 2007 16:46:45 -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:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; bh=HYWW8xo3W9LVDPEC0oEXlQPkzxGLhRdYKEN9R5JP2bM=; b=fX3czKpLTIy+rF8QsVo737uD6tkkG05Xsh4bfpXV+Wda2AAfFYfUASGQpzGyGfmBDtnH4BCaCiw4sH+DsMoZ7tYfoWWPm+mfReBAKRAbhB9J7fhLOV+5qAspvlXHaDWTPNxs3oweC8uhUsWuh8LlPi0CmASmTvUcDziRfxnfKSY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=rJxZSWp6k0HSAo/cfpIon2lcaVzMNqMu5yVrWK68NOfmY+iS8MR91zUf6SVJXICGkhFmLFm+WpJ7mh6wrQL3Vu2HZrIuqaYgcQhu4nApW7MtGgJ/cHGG/NbS1Wv1yYhuXgi1xoAd1hDCwcdcJlDpO4te4nFpEdVN6HSYJDN6irw= Received: by 10.82.154.12 with SMTP id b12mr4592176bue.1194047204293; Fri, 02 Nov 2007 16:46:44 -0700 (PDT) Received: from localhost ( [83.201.31.218]) by mx.google.com with ESMTPS id f8sm3651412nfh.2007.11.02.16.46.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2007 16:46:42 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Sat, 03 Nov 2007 00:47:39 +0100 Date: Sat, 3 Nov 2007 00:47:38 +0100 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] problem with gbutton Message-ID: <20071102234738.GA7257@localhost> References: 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-Spam: no; 0.00; gbutton:01 gbutton:01 lablgtk:01 ocaml:01 lablgtk:01 gobj:01 gwindow:01 gmain:01 gmain:01 ocamlc:01 gtkinit:01 cmo:01 angela:98 wrote:01 caml-list:01 On Fri, Nov 02, 2007 at 05:48:01PM -0500, Angela Zhu wrote: > Can anyone give me an example how to set a GButton.button to be > insensitive or not according to a boolean value "isActive"? The method #misc#set_sensitive, used by a few examples in the sources of LablGTK, and documented here: http://plus.kaist.ac.kr/~shoh/ocaml/lablgtk2/lablgtk-2.4.0/doc/html/GObj.misc_ops.html#METHODset_sensitive may do the job: % cat test.ml let _ = let window = GWindow.window () ~show: true in let button = GButton.button () ~label: "hello" ~packing: window#add in let isActive = false in button#misc#set_sensitive isActive; ignore (window#connect#destroy ~callback: GMain.quit); GMain.main () % ocamlc -o test -I +lablgtk2 lablgtk.cma gtkInit.cmo test.ml % ./test HTH, Julien.