TIP: 434 Title: Specify Event Sources for 'vwait' Version: $Revision: 1.1 $ Author: Jos Decoster State: Draft Type: Project Tcl-Version: 8.6 Vote: Pending Created: 26-Feb-2015 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 ''' 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.