From: James B. <jam...@ma...> - 2012-07-20 18:15:24
|
I've been looking at some of the performance issues on Lion with Apple's bundled Tcl/Tk 8.5. I've read on this list that the event loop code is complex and fragile and maybe there is no one around to fix this issue but here's a really simple demonstration, take the widget demo code: label .t -text "This widget is at the top" -bg red label .b -text "This widget is at the bottom" -bg green label .l -text "Left\nHand\nSide" label .r -text "Right\nHand\nSide" text .mid .mid insert end "This layout is like Java's BorderLayout" # Lay them out pack .t -side top -fill x pack .b -side bottom -fill x pack .l -side left -fill y pack .r -side right -fill y pack .mid -expand 1 -fill both Resize the window it behaves well. Now put that code in a paned window: panedwindow .pw -orient horizontal -bg gray -showhandle 1 frame .lf -bg #1f1f0f frame .rf -bg #0f1f1f .pw add .lf .rf text .lf.mid pack .lf.mid -expand 1 -fill both .lf.mid insert end "This text is in the left pane" label .rf.t -text "This widget is at the top" -bg red label .rf.b -text "This widget is at the bottom" -bg green label .rf.l -text "Left\nHand\nSide" label .rf.r -text "Right\nHand\nSide" text .rf.mid .rf.mid insert end "This layout is like Java's BorderLayout" # Lay them out pack .rf.t -side top -fill x pack .rf.b -side bottom -fill x pack .rf.l -side left -fill y pack .rf.r -side right -fill y pack .rf.mid -expand 1 -fill both pack .pw -expand 1 -fill both drag the paned window handle and move it back and forth quickly and compare that to again resizing the window. All sorts of drawing hiccups (flickering and so forth) with the paned window and none with resize the main window. I think it's telling that even with setting "-opaqueresize 0" on the paned widget you still see drawing artifacts when you let go and yet none if you resize the main window itself. Here's another odd thing, If you exaggerate the problem with populating the window with many widgets (again flawless with resizing the main window) you'll notice the widgets packed against the righthand side of the frame actually jiggle into position, so as you move the splitter bar smoothly to the right, any widget packed with "-side right" hop back and forth one pixel. Seems to me to indicate there is some off-by-one bug. No matter how fast I resize the main window I never see this right hand edge jiggle so it's not the packer code itself or the fact the frame is nested, more the source of the resize. I've also tried replacing the packer for grid and even place, makes no difference, weird redraw artifacts and jiggle remain. I wondered if given how quiet this list if there is anyone working or thinking about working on this? - James |