From: Michiel de H. <mjl...@ya...> - 2014-01-18 14:06:01
|
Hi Kevin. > Can you clarify the context of your observation? When you > mention "an external event loop," what are you referring to? I am using Tcl/Tk from Python, so Python is running the event loop, and Tcl/Tk hooks into it using the notifier approach as described e.g. here: http://www.tcl.tk/man/tcl8.5/TclLib/Notifier.htm > What kinds of problems arise? The external event loop handles both windows created by Tcl/Tk, and windows created independently of Tcl/Tk. This external event loop is similar to the one in Tcl/Tk, using [self nextEventMatchingMask:...] just like Tcl/Tk. The windows created by Tcl/Tk need the call to tkDisplayIfNeeded before each event; the windows created independently of Tcl/Tk don't need that. I cannot use [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO], because the Tcl/Tk-independent windows obviously don't have the tkDisplayIfNeeded method. Instead I would have to get a list of windows, check if they can handle tkDisplayIfNeeded, and if so, apply tkDisplayIfNeeded to them. This would have to be done before each and every event, slowing down the code and making it rather complex. > Would you be able to provide a patch that implements the > cleaner solution you are suggesting? That is simple: remove tkDisplayIfNeeded and the call to it from tkMacOSXNotify.c, and remove the line [window setAutodisplay:NO] from kMacOSXWm.c. If any glitches show up when we do that, we can think again what is the best solution for it. > I'd be very interested to see a bit more of your thinking; I am > wondering if this might solve some of the long-standing > issues with the event loop in Tk Cocoa. I have some experience with a Cocoa event loop (with Python though, but I guess the issues are the same), so I may be able to help. Best, -Michiel. |