From: Will D. <wi...@wj...> - 2014-09-29 15:16:06
|
On Sep 25, 2014, at 9:48 AM, Lars Hellström <Lar...@re...> wrote: > Kevan Hashemi skrev 2014-09-25 16.17: >> Dear Kevin, >> >> Thank you for all the work you are doing to keep Tk going on MacOS. >> >>> Re-engineering either of these foundational parts of Tcl would, as I >>> understand it, go far beyond adjusting a platform-specific >>> implementation of the current API >> >> Indeed it would. But the Tcl event loop has one severe limitation, and I >> believe it's the one Michiel is referring to. I had to build my own >> event loop on top of Tcl's, because Tcl's would not do the job. >> >> The problem with Tcl's event loop is that pending "vwaits" are resolved >> strictly in reverse order of initiation, and "after" events are ignored >> during an active vwait. > > That sounds very much like a misunderstanding, and also like you're using > far-from-recommended programming practices. > > [vwait]s are resolved in reverse order of initialisation, because each is a > recursive invokation of the event loop. The first advice on using [vwait] > tends to be to avoid that. And [after] events are being serviced during a > [vwait], since how else could the following terminate? > > % after 500 {incr epoch}; vwait epoch; set epoch > 1 > % after 500 {incr epoch}; vwait epoch; set epoch > 2 > > Your premises appear to be flawed. > I'm aware of two canonical uses for vwait: The first is when a non-event-loop program that needs to enter the event loop for short periods of time; in which case the event loop is not being called recursively. Presumably this case is not a problem. The second is when popping up modal dialogs such as tk_getOpenFile, where the dialog is truly modal. I see this case as reasonable, especially given that Tk itself does it. Will > > Lars Hellström > > > ------------------------------------------------------------------------------ > Slashdot TV. Videos for Nerds. Stuff that Matters. > http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk > _______________________________________________ > Tcl-mac mailing list > tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac |