From: Cristian S. <cri...@gm...> - 2013-07-06 11:14:58
|
> Unfortunately there are still some small issues, for example: > - Without the "break" in ttk_bindMouseWheel the message continues to be > propagated (add a line "return" in gamelist.tcl:823 to try what I mean) > With disabled glist.ybar_, mouse wheel is handled by Treeview class but in current master this does not happen because class bindtags are disabled by the breaks in ttk_bindMouseWheel. The patch removes these breaks so that ttk_bindMouseWheel could be (re)used as the native Tk one. Initially I relied only on class binding, but the Treeview scrolling does not work as you would expect and during testing I did not notice that. Only at the end I re-enabled glist.ybar_ to not break things. > - Mousewheel no longer works over the board when browsing a game > What do you mean? This should not happen, but I may have overlooked an obvious scenario. > I think the approach is the right one, but I think we should have a single > function that is called from the windows that want to handle the mousewheel > (autoscrollframe, main, gamelist, gbrowser; perhaps ttk_bindMouseWheel can > be > adapted), and within that function deal with the particular case where the > mouse is positioned in another window (creating another event directed to > the > right window). > I've played around with all the tips I could get my hands on and I found this approach to be the simplest to reason about. In the beginning I even dismissed it for adding code that should be in Tcl/Tk in the first place. The single function approach (for example TIP 171 http://www.tcl.tk/cgi-bin/tct/tip/171.html which was my first choice) has the problem that it adds a scroll to any canvas even if you don't want that. The obvious problem is when you scroll the game and the board canvas scrolls, or in FICS, you scroll over the clock and the clock canvas scrolls. So instead of adding scroll to every canvas and then removing the wrong ones, one by one, I prefer to know exactly what bindings there are. With this approach, I don't add any more bindings then I disable so the net result is zero. The only binding that I added was to glist.ybar_ since without it the Treeview scroll was not enough. Two ideas: - ttk_bindMouseWheel (preferable ttk::bindMouseWheel for transparency) could make use of a "break" optional argument that defaults to no. - If you know about other classes used in scid that fire under MouseWheel, those should also be disabled Cristian |