English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
LablTk
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-07-16 (21:57)
From: Fabien Fleutot <fabien.fleutot@i...>
Subject: LablTk
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 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...