Version française
Home     About     Download     Resources     Contact us    
Browse thread
LablTk
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: LablTk
From: Fabien Fleutot <fabien.fleutot@inria.fr>

>    > - 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
		<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>