From: Kevin W. <kw...@co...> - 2011-07-27 21:17:58
|
[repost from c.l.t, sent there by mistake] Hi all, I've been wrestling with a bug in Tk-Cocoa that is leaving me stumped, and I'm wondering if anyone else has any insight. I wrote this code to test some minor updates to the wm manage/wm forget commands that I've implemented for Tk. The code should work under the latest release of ActiveTcl, if you don't have that version. The bug I'm trying to track down is an issue with the screen redraw. When you run this code in Wish, and click the "dock" button, you'll get a new toplevel, per the [wm manage] command. Close the window, and the widget is packed again. Click the "dock" button again, and you may see *two* buttons drawn in the new toplevel, and/or some blurry lines/spots that indicate visual trash that hasn't been cleaned up. It doesn't happen on the first firing of wm forget/wm manage, but on subsequent ones. The code below is the simplest illustration of issues with sluggish or incomplete screen redraw that I can come up with. I've observed this in Tk-Cocoa for a couple of years now, but others are seeing it also (Torsten Berg reported the bug on c.l.t), and it seems to be an issue. Daniel, if you're reading, any suggestions about where in the source tree I should look at to deal with this? Getting deep into the internals of Tk drawing is a bit out of my depth, and any pointers are appreciated. Code is below. (I *hope* this code doesn't display another bug, which is a hard crash under certain circumstances with the wm forget command, but that's another issue.) Thanks. proc tearoff {w} { global docked pack forget $w wm manage $w update wm protocol $w WM_DELETE_WINDOW [list untearoff $w] } proc untearoff {w} { wm forget $w pack $w } pack [frame .f] pack [button .f.b -text "Dock" -command {tearoff .f}] --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com |