1#
2# eventloop.tcl --
3#
4# Eventloop procedure.
5#------------------------------------------------------------------------------
6# Copyright 1992-1999 Karl Lehenbauer and Mark Diekhans.
7#
8# Permission to use, copy, modify, and distribute this software and its
9# documentation for any purpose and without fee is hereby granted, provided
10# that the above copyright notice appear in all copies.  Karl Lehenbauer and
11# Mark Diekhans make no representations about the suitability of this
12# software for any purpose.  It is provided "as is" without express or
13# implied warranty.
14#------------------------------------------------------------------------------
15# $Id: events.tcl,v 1.1 2001/10/24 23:31:48 hobbs Exp $
16#------------------------------------------------------------------------------
17#
18
19#@package: TclX-events mainloop
20
21proc mainloop {} {
22    global tcl_interactive
23
24    if {[info exists tcl_interactive] && $tcl_interactive} {
25        commandloop -async -interactive on -endcommand exit
26    }
27    set loopVar 0
28    catch {vwait loopVar}
29    exit
30}
31
32
33