For Programmers: Free Programming Magazines  


Home > Archive > Tcl > May 2007 > Re: tablelist and mousewheel bindings









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: tablelist and mousewheel bindings
Csaba Nemethi

2007-05-22, 7:12 pm

Michael Schlenker schrieb:
> Hi all,
>
> i tried to use tablelist with the tklib style package, specifically the
> as style, which provides mousewheel bindings. (on Windows XP specifically)
>
> Sadly it does not work as expected, probably because the wrong
> subcomponent of the tablelist gets the mousewheel events.
>
> I see the text widget component scrolling when using the mousewheel, but
> the scrollbars attached to the tablelist don't react to that scrolling.
>
> Sometimes i even see trash in the text widget, when scrolling with the
> mousewheel.
>
> So is there any simple to use recipe for adding mousewheel bindings to a
> tablelist?
>
> Michael


Tablelist comes with built-in mousewheel support. It works exactly like
in the case of the Tk listbox. This means, among others, that on
Windows the widget will only react to <MouseWheel> events if it has the
focus. The easiest way to achieve this is to configure your tablelist
widget with the -setfocus option, which makes sure that a left mouse
click will set the focus to the tablelist widget's body.

I have never tried the tklib style package, and, unfortunately, right
now I have no time for examining it. But, judged by a first look, I
think that its only significant improvement regarding the mouse wheel
support is that it automatically sets the focus to the widget. As
already said, you can make sure that this is done by a left mouse click,
after which the built-in mouse wheel binding script will produce the
expected behavior.

--
Csaba Nemethi http://www.nemethi.de mailto:csaba.nemethi@t-online.de
Jeff Hobbs

2007-05-24, 10:08 pm

Csaba Nemethi wrote:
> Michael Schlenker schrieb:
>
> Tablelist comes with built-in mousewheel support. It works exactly like
> in the case of the Tk listbox. This means, among others, that on
> Windows the widget will only react to <MouseWheel> events if it has the
> focus. The easiest way to achieve this is to configure your tablelist
> widget with the -setfocus option, which makes sure that a left mouse
> click will set the focus to the tablelist widget's body.
>
> I have never tried the tklib style package, and, unfortunately, right
> now I have no time for examining it. But, judged by a first look, I
> think that its only significant improvement regarding the mouse wheel
> support is that it automatically sets the focus to the widget. As
> already said, you can make sure that this is done by a left mouse click,
> after which the built-in mouse wheel binding script will produce the
> expected behavior.


Actually the significant improvement is that it removes the MouseWheel
handling from all other widgets. This may need special overriding in
the case of megawidgets like tablelist. However, if you do use such
overrides, you should make sure that your MouseWheel bindings uses 'break'.

Jeff
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com