From: Kevin W. <kw...@co...> - 2014-12-24 05:09:14
|
On 12/22/14 9:38 PM, Kevin Walzer wrote: >> As I noted yesterday, I have run into a wall on trying to address bugs >> >with the scrollbar in Tk-Cocoa, as reported here by Linus Nyberg: >> > >> >https://sourceforge.net/p/tcl/mailman/message/33162978/ >> > >> >(Linus, by the way, can you please file a bug report at the tracker at >> >http://core.tcl.tk/tk/reportlist? Thanks.) >> > >> >I've also run into a similar wall on trying to address the menubutton >> >widgets as reported by Russell Owen here: >> > >> >http://core.tcl.tk/tk/tktview/7a325ad72cbb6e331fbae3f4116fe112bda698f4 >> > >> >I am now asking for help from the community in addressing these bugs. > After taking a bit time to consider an approach to these bugs, I have > decided to revisit the issues by adding to the ttk package (it currently > lacks a scrollbar for OS X), and also by borrowing from the ttk approach > for buttons, etc. This will reduce the amount of work relative to > re-implementing the button and scrollbar code from scratch. When I have > more to report and /or test, I will post here. And now, after a day of hacking, I've done a couple of commits to trunk and core-8-5-branch that implement the following Tk/Cocoa improvements: 1. The scrolling flicker issue appears to be gone. I've addressed this by implementing custom drawing of the scrollbar that mimics the standard Cocoa UI as closely as possible. I do not fully understand why this seems to fix the issue that Linus reports, as well as multiple other issues that I've observed with "ghosted" scrollbars, but all my tests show no issues. The new drawing is supported on 10.7 and above, when the new scrollbar style was introduced. I have not tested this on 10.6 and below, and do not plan to. Linus, please test the update and I'll close the bug if you confirm it works. 2. I've made substantial improvement in how the menubutton is rendered during window resizing, which was the basis of Russell's bug report. When the menubutton is in a mapped state the flicker is completely gone. When unmapped, alas, it still shows up as a "ghost" image, but the flicker is somewhat reduced. I do not know how to resolve this, but I will take the substantial improvement here as a win. Russell, please test the update and I'll close the bug if you confirm it works. 3. As a happy side effect of the menubutton fix, window performance in general seems improved during resizing. I added a couple of method calls that defer some redrawing while the window is being resized, and that seems to smooth things out a good deal. I think these fixes are sufficient for now. As you know, I had spent some time looking at the possibility of borrowing some of ttk's code in rendering buttons, menubuttons, and the like using the HITheme API, but integrating that with Cocoa is simply impractical or far more work than I wanted to take on. In any case, I think things are now on more solid ground after the removal of the private API's, and I'll continue to investigate incremental improvements as time and bug reports allow. And my earlier invitation to submit patches stands: some of the big improvements over the past year are things I could never have come up with on my own! Enjoy these improvements as an early Christmas present. Happy holidays, Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com |