Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tcl and the 'after' command ... Question?

0 views
Skip to first unread message

Jonathan Jones

unread,
Apr 8, 1999, 3:00:00 AM4/8/99
to
Is there a strict 'Tcl' command (or code) equivalent to 'dp_after'?
'dp_after'
(part of the Tcl-dp3.2 extension) is equivalent to the Tk 'after'
command,
except that it operates even if the X server is not present.
Unfortunately,
this is no longer supported under tcl-dp4.0. When Tk's 'after' command
is
executed (under Tcl) the following situations are successful;

after 'ms' (i.e., after 5000)
after cancel 'id'
after info

however, it fails for this situation (which happens to be the most
important
to me):

after 'ms' 'script' (i.e., after 5000 { puts stderr "hi" })

Upon several executions of the above statement, 'after info' shows that
scripts
scripts have not been processed (even WAY after the elapse time).

Does anybody have any ideas, or work arounds? I'm currently using Tcl
7.6 with
Tcl-dp 4.0 on an HP-UX 10.20 machine.

Thanks,
Jonathan

Hemang Lavana

unread,
Apr 11, 1999, 3:00:00 AM4/11/99
to Jonathan Jones
> after 'ms' 'script' (i.e., after 5000 { puts stderr "hi" })
>
> Upon several executions of the above statement, 'after info' shows that
> scripts
> scripts have not been processed (even WAY after the elapse time).

Do you specifically enter the event loop in tclsh, such as: `vwait
forever'?

From man page of after:
The after ms and after idle forms of the command assume that the
application is event driven: the delayed commands will not be
executed unless the application enters the event loop. In applications

that are not normally event-driven, such as tclsh, the event loop can
be entered with the vwait and update commands.

--
Hemang Lavana mailto:lav...@cbl.ncsu.edu http://www.cbl.ncsu.edu/~lavana
Off: 2300 CBL, Research IV, Centennial Campus, |Res: 1707-4, Crest Rd.,
NCSU, Box 7550, Raleigh, NC 27695-7550. | Raleigh, NC 27606.
Ph: (919) 515-9677, Fax: (919) 513-1895 | Ph: (919) 821-0913


0 new messages