From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id BAA13058; Thu, 2 Oct 2003 01:54:52 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA15397 for ; Thu, 2 Oct 2003 01:54:51 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h91NslH12357 for ; Thu, 2 Oct 2003 01:54:48 +0200 (MET DST) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2-20030924/3.7W) with ESMTP id IAA13044; Thu, 2 Oct 2003 08:54:41 +0900 (JST) To: Vincent.Barichard@info.univ-angers.fr Cc: caml-list@inria.fr Subject: Re: [Caml-list] self widget call in camltk In-Reply-To: <3F7AC194.000003.04488@lanfeust> References: <3F7AC194.000003.04488@lanfeust> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20031002085455Y.garrigue@kurims.kyoto-u.ac.jp> Date: Thu, 02 Oct 2003 08:54:55 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 widget:01 jacques:01 barichard:01 barichard:01 univ-angers:01 labltk:01 gui:01 jacques:01 command:98 command:98 garrigue:01 garrigue:01 configure:02 configure:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: "Vincent Barichard" > I use labltk to build a gui for a programm where I need that a button b1 can > enable another button b2 and disable itself. For example : > > let b1 = Button.create top ~text:"b1" ~state:`Disabled > ~command:(fun _ -> Button.configure b2 ~state:`Active; > Button.configure b1 ~state:`Disabled);; > let b2 = Button.create top ~text:"b2" > ~command:(fun _ -> Button.configure b1 ~state:`Active; > Button.configure b2 ~state:`Disabled);; That's pretty classical. You can add the command after creating the button: let b1 = Button.create top ~text:"b1" ~state:`Disabled let b2 = Button.create top ~text:"b2" let () = Button.configure b1 ~command:(...); Button.configure b2 ~command:(...) Jacques Garrigue ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners