From: Adrian R. <adr...@gm...> - 2012-02-13 19:20:22
|
Hi, I've been trying to port an application to Tk Cocoa and one of the differences I've been running into is display refresh. I don't know if there is just one problem or multiple problems, but it seems like updates from the Tk side are prioritized lower than in Carbon. Observations on 10.6 (all differences from Mac/Carbon, Windows, and X): 1) if you make changes to a canvas widget, and then take it offscreen, the changes are not visible the next time you bring it onscreen (instead they come after a short delay) 2) when extending the size of a window by PACKing something onto the bottom, the sequence happens thusly: a) the window size is extended; b) the entire contents of the window are redrawn starting from the new bottom; c) the height information for the contents of the new piece start getting paid attention to, which causes a second redraw of the contents back in the original position 3) the bug here (http://sourceforge.net/tracker/?func=detail&aid=3166688&group_id=12997&atid=112997), where using pack / pack forget to switch a tabbed display fails to refresh in timely fashion Before I dive into the event loop and display refresh code in Tk Cocoa (and who knows if I'll come out), has anyone else taken a look at this and/or have any insights or suggestions to offer from other experience with refresh/event loop in Cocoa or Tk? thanks, Adrian |
From: Kevin W. <kw...@co...> - 2012-02-13 22:20:40
|
On 2/13/12 2:20 PM, Adrian Robert wrote: > Hi, > > I've been trying to port an application to Tk Cocoa and one of the differences I've been running into is display refresh. I don't know if there is just one problem or multiple problems, but it seems like updates from the Tk side are prioritized lower than in Carbon. Observations on 10.6 (all differences from Mac/Carbon, Windows, and X): > > 1) if you make changes to a canvas widget, and then take it offscreen, the changes are not visible the next time you bring it onscreen (instead they come after a short delay) > > 2) when extending the size of a window by PACKing something onto the bottom, the sequence happens thusly: a) the window size is extended; b) the entire contents of the window are redrawn starting from the new bottom; c) the height information for the contents of the new piece start getting paid attention to, which causes a second redraw of the contents back in the original position > > 3) the bug here (http://sourceforge.net/tracker/?func=detail&aid=3166688&group_id=12997&atid=112997), where using pack / pack forget to switch a tabbed display fails to refresh in timely fashion > > > Before I dive into the event loop and display refresh code in Tk Cocoa (and who knows if I'll come out), has anyone else taken a look at this and/or have any insights or suggestions to offer from other experience with refresh/event loop in Cocoa or Tk? > > > thanks, > Adrian > Hi Adrian, You have hit upon one of the knottiest issues with Tk-Cocoa--its event loop is noticably slower than Carbon's in some respects. If you check the list archives and the bug reports at SF, you'll see various reports, investigations (many by me), and discussions. Bottom line, this is extremely complex to address and I've found it frankly beyond my skill. Integrating Tk and Cocoa's event loops seems to be a much more complicated process than Carbon's; that is what Daniel Steffen has indicated. Its sheer complexity may make the integration more fragile and bugs harder to address. I'd welcome your input if you have time to take a look. I've found the internals of the event loop so hairy that I've not been able to make any headway, and have more or less punted in case someone else wants to take a stab at it. Thanks, Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com |
From: Zbigniew D. <z....@gm...> - 2012-02-20 17:31:58
|
Am 13.02.2012 20:20, schrieb Adrian Robert: > Hi, > > I've been trying to port an application to Tk Cocoa and one of the > differences I've been running into is display refresh. I don't know > if there is just one problem or multiple problems, but it seems like > updates from the Tk side are prioritized lower than in Carbon. > Observations on 10.6 (all differences from Mac/Carbon, Windows, and > X): I have ported my application to MacOSX Tk 8.5.11 and try to synchronize the Tk event loop and Cocoa's event loop by inserting often an "update idletasks" before using critical GUI commands like menu, grab, focus, wm iconify and so on. Sometimes the "grab" command has to be omitted at all. |
From: Kevin W. <kw...@co...> - 2012-02-21 02:34:09
|
On 2/20/12 12:31 PM, Zbigniew Diaczyszyn wrote: > Am 13.02.2012 20:20, schrieb Adrian Robert: >> Hi, >> >> I've been trying to port an application to Tk Cocoa and one of the >> differences I've been running into is display refresh. I don't know >> if there is just one problem or multiple problems, but it seems like >> updates from the Tk side are prioritized lower than in Carbon. >> Observations on 10.6 (all differences from Mac/Carbon, Windows, and >> X): > > I have ported my application to MacOSX Tk 8.5.11 and try to synchronize > the Tk event loop and Cocoa's event loop by inserting often an "update > idletasks" before using critical GUI commands like menu, grab, focus, wm > iconify and so on. Sometimes the "grab" command has to be omitted at all. > These types of workarounds are the most effective way to deal with the event loop issue--it may require some trial and error. -- Kevin Walzer Code by Kevin http://www.codebykevin.com |