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 JAA15629 for caml-red; Fri, 21 Jul 2000 09:37:55 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA06763 for ; Fri, 21 Jul 2000 02:43:30 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e6L0hMj26664; Fri, 21 Jul 2000 02:43:23 +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 JAA25959; Fri, 21 Jul 2000 09:43:20 +0900 (JST) To: fabien.fleutot@inria.fr Cc: caml-list@inria.fr Subject: Re: LablTk In-Reply-To: Your message of "Mon, 10 Jul 2000 15:51:19 +0200" <3969D4D7.8001219E@inria.fr> References: <3969D4D7.8001219E@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: <20000721094253L.garrigue@kurims.kyoto-u.ac.jp> Date: Fri, 21 Jul 2000 09:42:53 +0900 From: Jacques Garrigue X-Dispatcher: imput version 980905(IM100) Sender: weis@pauillac.inria.fr From: Fabien Fleutot > I have two problems with LablTk : > > - 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. If you really need this kind of power, you may consider switching to GTK. > - I want to use a button to destroy a window. But I can't do > > Button.create win ~text:"Close" ~command:(fun _ -> destroy win) > > since when the destroy function starts, the button, which belongs to > win, is in use and prevents to destroy its parent win. There is a > specific function (i.e. Tk_EventuallyFree) in Tcl/Tk to handle such > cases, but I don't know how to do with LablTk. What I'm currently doing > is to put the destroying function in a Timer callback, to destroy the > window .1s after the button has been released, but it's not very safe... I don't see why your above code wouldn't work. I'm doing it everywhere in ocamlbrowser (Jg_button.create_destroyer). Jacques --------------------------------------------------------------------------- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp JG