If some other package has done a vwait, then that would be the end of loading
code and your main program (with its vwait) will never run. The only other
way the event loop would be entered is if someone did a 'package require Tk'
(and you can test for that:
if {![catch package present Tk]} {
vwait forever
}
)
Typically to enter the event loop in a *non* Tk program, you would have
vwait forever
as the very last thing in the main script. This statement is never going to
return to the command level, unless someone sets the 'forever' variable (which
would be a really dumb thing to do). Not that there is anything special
about the variable name 'forever' -- you can use any name you like, but the
name forever is the one 'traditionally' used for just this purpose. And it
nicely documents what is going on here.
Basically, there really isn't any real need to test for the event loop already
existing, outside of testing for the Tk package.
>
> Eric
--
Robert Heller --
978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
hel...@deepsoft.com -- Webhosting Services