From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA24930 for caml-red; Fri, 21 Jul 2000 23:16:20 +0200 (MET DST) 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 KAA15503 for ; Fri, 21 Jul 2000 10:37:04 +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.10.0/8.10.0) with ESMTP id e6L8b2b12596; Fri, 21 Jul 2000 10:37:02 +0200 (MET DST) Received: from localhost (sansho.kurims.kyoto-u.ac.jp [130.54.16.90]) by kurims.kurims.kyoto-u.ac.jp (8.9.3/3.7W) with ESMTP id RAA29373; Fri, 21 Jul 2000 17:37:00 +0900 (JST) To: fabien.fleutot@inria.fr Cc: caml-list@inria.fr Subject: Re: LablTk In-Reply-To: Your message of "Fri, 21 Jul 2000 09:40:49 +0200" <200007210740.e6L7enk29607@faure.inria.fr> References: <200007210740.e6L7enk29607@faure.inria.fr> X-Mailer: Mew version 1.93 on Emacs 20.5 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20000721173633H.garrigue@kurims.kyoto-u.ac.jp> Date: Fri, 21 Jul 2000 17:36:33 +0900 From: Jacques Garrigue X-Dispatcher: imput version 980905(IM100) Sender: weis@pauillac.inria.fr From: Fabien Fleutot > > - I want to prevent a window from being destroyed by the WM : it's a > > pretty long to build window, and I'd like to hide it instead of actually > > destroy it when the user clicks on the delete button of the window > > manager. It's easy to do in some langages such as Java, but I can't find > > the way to do it with Labltk. > > I do not see anything to do that in Tcl/Tk. You can iconify a window, > using Wm.iconify, but not hide it. > > One can do it with ``Wm.withdraw''. This function exists in Labltk; > the problem is to say it to use my own function rather than the > standard delete function when the window destruction is requested by > the Wm. My mistake. So your problem is how to bind the Destroy event, avoiding its actual execution. And I don't know how it can be done; break does not work in that specific case. Strangely enough, the window is only destroyed after the script was executed, which gives you time to say to the user that he has done something wrong, but there is no way to stop it. Actually I would like to know, since I have uses for it. > If you really need this kind of power, you may consider switching to > GTK. > > ...as soon as it will be included in the standard OCaml > distribution: I don't want people to have to download and install > dozens of libs before being able to compile my soft, esp. on > platforms other than linux. Then you will have to stick to Tk, which is available on most platforms. Having moving APIs in the standard distribution does not sound nice, and LablGTK's API is not stable yet. --------------------------------------------------------------------------- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp JG