| Author |
Link windows to another toplevel
|
|
| Jeannot 2004-03-27, 12:27 am |
| Hello all,
I am writing actually an application in bioinformatics using mutiple
canvas and other toplevel windows. I am running on compaq cluster with
True Unix 64.
My application creates a canvas where I draw several things .. then
starting from this canvas I launch other windows (toplevel) which are
independant from my first canvas and contains related results from the
first canvas.
Principle canvas name: .canva1 (for ex I launch many of this starting
window !!)
Then I can have other windows (toplevel) which display the results
linked to what is inside .canva1.: ex: .fenetre1 .fenetre2 ...
So my question is : Is it possible to link the destroy of .canva1 to
the destroy of all other windows ???
I have tried something:
I store all additional windows (.fenetre1 .fenetre2 ...) and I am able
to destroy them within the proc DestroyAllOtherWindows
Adding this code to .canva1 bind <destroy> "DestroyAllOtherWindows
..canva1" but it seems to work half of the time ??!! (maybe the destroy
signal is too fast to be interceped ??!!)
I hope I made me clear ?? Thank you for your reply
Jeannot
French PhD student
| |
| Bryan Oakley 2004-03-27, 12:27 am |
| Jeannot wrote:
> So my question is : Is it possible to link the destroy of .canva1 to
> the destroy of all other windows ???
Yes. Make the other windows children of the canvas.
canvas .c
toplevel .c.top1
destroy .c
You'll see that the toplevel is destroyed when the canvas is destroyed.
| |
| Ulrich Schöbel 2004-03-27, 12:27 am |
| In article <260e39a9.0403260606.43b6180f@posting.google.com>,
muller_jean@hotmail.com (Jeannot) writes:
> Hello all,
>
> I am writing actually an application in bioinformatics using mutiple
> canvas and other toplevel windows. I am running on compaq cluster with
> True Unix 64.
>
> My application creates a canvas where I draw several things .. then
> starting from this canvas I launch other windows (toplevel) which are
> independant from my first canvas and contains related results from the
> first canvas.
>
> Principle canvas name: .canva1 (for ex I launch many of this starting
> window !!)
> Then I can have other windows (toplevel) which display the results
> linked to what is inside .canva1.: ex: .fenetre1 .fenetre2 ...
>
> So my question is : Is it possible to link the destroy of .canva1 to
> the destroy of all other windows ???
>
> I have tried something:
> I store all additional windows (.fenetre1 .fenetre2 ...) and I am able
> to destroy them within the proc DestroyAllOtherWindows
> Adding this code to .canva1 bind <destroy> "DestroyAllOtherWindows
> .canva1" but it seems to work half of the time ??!! (maybe the destroy
> signal is too fast to be interceped ??!!)
>
> I hope I made me clear ?? Thank you for your reply
>
> Jeannot
>
> French PhD student
Hi Jeannot,
make the toplevels children of the canvas:
toplevel .canva1.fenetre1
A 'destroy .canva1' will also destroy its children, the other toplevels.
Best regards
Ulrich
--
For those of you who don't get this e-mail, let me know and I'll re-send it.
| |
| Bob Techentin 2004-03-27, 12:27 am |
| "Jeannot" <muller_jean@hotmail.com> wrote
....
> Adding this code to .canva1 bind <destroy> "DestroyAllOtherWindows
> .canva1" but it seems to work half of the time ??!! (maybe the
destroy
> signal is too fast to be interceped ??!!)
Don't bind to the <destroy> event. See
http://wiki.tcl.tk/CatchingWindowManagedEvents
Bob
--
Bob Techentin techentin.robert@NOSPAMmayo.edu
Mayo Foundation (507) 538-5495
200 First St. SW FAX (507) 284-9171
Rochester MN, 55901 USA http://www.mayo.edu/sppdg/
| |
| Jeannot 2004-03-27, 12:27 am |
| Thanks !! If could do this I would ...
Maybe I was not clear on that point but in fact I can't use the "other
toplevels" as childrens !!! But you are rigth it is the easiest way !!! The
procedure I use came from other people so it would hard to change their code
!!
Any way do you think there is another way do it ??
"Ulrich Schöbel" <usus@aladyn.de> a écrit dans le message de
news:4ie14c.joc.ln@usus.aladyn.de...
> In article <260e39a9.0403260606.43b6180f@posting.google.com>,
> muller_jean@hotmail.com (Jeannot) writes:
>
> Hi Jeannot,
>
> make the toplevels children of the canvas:
>
> toplevel .canva1.fenetre1
>
> A 'destroy .canva1' will also destroy its children, the other toplevels.
>
> Best regards
>
> Ulrich
>
>
> --
> For those of you who don't get this e-mail, let me know and I'll re-send
it.
| |
| Jeannot 2004-03-30, 2:37 am |
| No it was really helpful !!! Thanks a lot !!
I am sorry but my window containing the canvas is a frame toplevel that can
handle with wm.
So I put the two lines in the proc creating that window (with the canvas)
1:button $Boutons.dismiss -text "Dismiss" -background "red" -command "eval
\[wm protocol $w WM_DELETE_WINDOW\]" -padx 3
2: wm protocol $w WM_DELETE_WINDOW "after 10 destroy $w"
And in the proc which is responsible fot the use and creation of objects in
the canvas I put another line to handle with destroying other windows
wm protocol $w WM_DELETE_WINDOW "KillAllOtherWindowsFrom $K;after 10 destroy
$w"
Thanks and sorry for not providing all info ...
Jeannot
"Bob Techentin" <techentin.robert@mayo.edu> a écrit dans le message de
news:c4218g$k6e$1@tribune.mayo.edu...
> "Bruce Hartweg" <bruce-news@hartweg.us> wrote
>
> *sigh* Thanks for the correction, Bruce. (I'm just not being very
> helpful this w ...)
>
> Bob
> --
> Bob Techentin techentin.robert@NOSPAMmayo.edu
> Mayo Foundation (507) 538-5495
> 200 First St. SW FAX (507) 284-9171
> Rochester MN, 55901 USA http://www.mayo.edu/sppdg/
>
>
>
|
|
|
|