TIP #434: SPECIFY EVENT SOURCES FOR 'VWAIT'
=============================================
Version: $Revision: 1.1 $
Author: Jos Decoster <jos.decoster_at_gmail.com>
State: Draft
Type: Project
Tcl-Version: 8.6
Vote: Pending
Created: Thursday, 26 February 2015
URL: http://purl.org/tcl/tip/434.html
WebEdit: http://purl.org/tcl/tip/edit/434
Post-History:
-------------------------------------------------------------------------
ABSTRACT
==========
This TIP proposes to extend the *vwait* Tcl command so the event
sources can be specified, as is possible with the *Tcl_DoOneEvent* C
command.
RATIONALE
===========
In some situations it can be required not to wait for specific event
sources or to wait for specific events sources only. You might want the
program to only react on timer events, and not on file or window
events. You can write your own version of the *Tcl_VwaitObjCmd* command
in C, and call *Tcl_DoOneEvent* with the flags you need. Making it
possible to specify the event sources, i.e. the arguments for the call
to *Tcl_DoOneEvent* within *Tcl_VwaitObjCmd*, from the Tcl *vwait*
command would make this functionality available from the Tcl lebvel.
SPECIFICATION
===============
This document proposes to add optional arguments to the *vwait*
command. If these arguments are not specified, the current event source
*TCL_ALL_EVENTS* will be used. If the optinal arguments are specified,
they are the event sources to be passed to *Tcl_DoOneEvent* within
*Tcl_VwaitObjCmd*. The flags set with the optinal arguments will be
or-ed. Possible flags are corresponding to the flags for the
*Tcl_DoOneEvent* command:
* *-all* (default) - process all events
* *-file* - process file events
* *-idle* - process idle events
* *-timer* - process timer events
* *-window* - process window system events
Example: wait until variable *a* is written and only allow timer events
to be processed:
vwait a -timer
ALTERNATIVES
==============
A possible alternative is to add support for a *-events <event_list>*
argument.
A *-dont_wait* argument is not added, a call to *update* will have the
same effect.
COMPATIBILITY
===============
No incompatibilities are introduced.
REFERENCE IMPLEMENTATION
==========================
A reference implementation is available.
COPYRIGHT
===========
This document has been placed in the public domain.
-------------------------------------------------------------------------
TIP AutoGenerator - written by Donal K. Fellows
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Tcl-Core mailing list
Tcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-core