-----BEGIN PGP SIGNED MESSAGE-----

I'm a bit confused as to how to correctly create a multi-window tcl/tk
script using vt, where only the main window is initially started.

Here is what I've done. Using vt, I've created a tcl/tk script with
two TOPLEVEL windows. In the Geometry Information window of vt, I set
the "state" flag of the main TOPLEVEL window (.top17) to "normal", and
set the "state" flag of the second TOPLEVEL window (.top25) to
"withdrawn". Here is a snippet of the two vTclWindow procedures vt
created:

proc vTclWindow.top17 {args} {
    set base .top17
    if {[winfo exists .top17]} {
        wm deiconify .top17; return
    }
    ###################
    # CREATING WIDGETS
    ###################
    toplevel .top17 -class Toplevel
    wm focusmodel .top17 passive
    wm deiconify .top17
}

proc vTclWindow.top25 {args} {
    set base .top25
    if {[winfo exists .top25]} {
        wm deiconify .top25; return
    }
    ###################
    # CREATING WIDGETS
    ###################
    toplevel .top25 -class Toplevel
    wm focusmodel .top25 passive
    wm withdraw .top25
}

This looks ok to me (.top17 is marked "deiconify", and .top25 is
marked "withdraw"). At the bottom of the tcl/tk script, vt included
the following:

Window show .
Window show .top17

vt didn't include a `Window show .top25` command, should it have? 

When I start the tcl/tk script, it correctly starts only the .top17
window. When it comes time to start the .top25 window, I have the
tcl/tk script execute a `Window show .top25` command, but nothing
happened. I think the reason nothing is happening is that .top25 is
marked withdraw, and thus when it is first started it doesn't pop
up. I tried the following tests to fix the problem:

Test 1:

To the original code, I included two calls to `Window show .top25` at
the point I want .top25 to pop up. As before, the first call didn't
cause the .top25 window to pop up, but the second call did. During the
same test I make one call to `Window hide .top25`, and one call to
`Window show .top25`, and that worked ok. It seems strange that I have
to start the process off by calling `Window show .top25` twice.

Test 2:

To the original code, I manually inserted a `Window show .top25`
command following the `Window show .top17` at the bottom of the tcl/tk
script vt created. When I run the script everything works correctly
(.top25 pops up with only one call to `Window show .top25`). Although
this worked, it seems wrong to fix it this way for two reasons:

1) I'm creating overhead starting up a window I might never need. I 
   realize that with only two windows, there isn't a lot of overhead,
   but I plan on having around 20-30 windows by the time I'm done, and
   I don't want any of them started unnecessarily.

2) vt removes the `Window show .topxx` lines for any window marked
   "withdraw", so I have to go back and enter them all in by hand
   after any change I make using vt.

Test 3:

To the original code, I changed the status of .top25 from "withdraw"
to "normal". This caused the wm setting for .top25 to be changed to
"deiconify", but it also caused a `Window show .top25` line to be
added to the end of the tcl/tk script. Now, when I start up the tcl/tk
script, both .top17 and .top25 pop up.

Conclusion of the above 3 tests:

What I think I want vt to do is set the status for .top25 to
"deiconify" (so that one call to `Window show .top25` will pop up the
window), but not include a `Window show .top25` at the bottom of the
tcl/tk script (so that the .top25 window only pops up when I want it
to).

Questions:

1) Is my conclusion the best approach to take to get the results I
   want?

2) How do I tell vt to do that? All of my tests required that I make
   manual changes to the tcl/tk script after vt created it to get the
   results I wanted, and I would rather have vt do all of the work if
   possible.

                                Thanks!


     ____  __   __   EMail:     mailto:[EMAIL PROTECTED]
      /   /_/  /_    VMail:     (313) 577-4742 
     /.  /\.  __/.   Fax:       (313) 577-5626
                     Home Page: http://tom.cc.wayne.edu
                     Anon FTP:  ftp://tom.cc.wayne.edu

   For my PGP PUBLIC KEY BLOCK,
       finger [EMAIL PROTECTED]

"A common mistake that people make when trying
 to design something completely foolproof was         Douglas Adams
 to underestimate the ingenuity of complete           Mostly Harmless
 fools."


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQEVAwUBMv97OYVgjprcM4kpAQF1Kgf+N2J54VXqCLCrpTK2rpJHpkkEgXGmgDx8
R1OR/+aUHw6jfJGfo6RWCMEEQPj3F+9DCjy/kYnWfXHDoAmdOhb5hFzpkQAkWLNk
nwlBFGo1XMTUcccO/9pwP82NtFkaqr9PfS3Hz0+8Nqhh9tQIIJ9K+lIwkQ7Enw7W
hdcoidM8bQuHTU04TCEJIZGuBjQ8cEdRj3mqTAfqmGgBAw3/1OBpFPMLBuKFOiUh
aQV9Isy7f8Seka6BJTWF7I+KEShMFjzuPTuXR/uFuS8A1GydA6y/0SUZIPr1uujt
rEOcInD9HN212EIWtm0Ii6NJcbxvzb0rvXKXjXcfZ4MvjPxoyVS8nQ==
=Tr7U
-----END PGP SIGNATURE-----

Reply via email to