Subject: | Scrolled Entry widgets: `bad option "yview"` when scrolled using mouse wheel |
Attempting to scroll a Scrolled Entry widget using the mouse wheel causes an error:
Tcl::pTk::Error: bad option "yview": must be bbox, cget, configure, delete, get, icursor, index, insert, scan, selection, validate, or xview
This occurs on any platform.
This is because MouseWheelBind() in pTk.pm causes <MouseWheel> events to always invoke yview() even for Entry widgets which do not scroll vertically. This code is mostly adapted from Perl/Tk; however, this error doesn't occur on Perl/Tk because it doesn't use MouseWheelBind() on Entry widgets.
If I insist MouseWheelBind() handle any kind of scrollable widget, the challenge is determining whether a widget can do yview(). It is handled by AUTOLOAD, so I can't use $_[0]->can('yview') (try not to not do anything expensive in the callback sub anyways; hopefully it can be something done once in MouseWheelBind()). Do I really have to hardcode which widgets support yview()?
Tcl::pTk::Error: bad option "yview": must be bbox, cget, configure, delete, get, icursor, index, insert, scan, selection, validate, or xview
This occurs on any platform.
This is because MouseWheelBind() in pTk.pm causes <MouseWheel> events to always invoke yview() even for Entry widgets which do not scroll vertically. This code is mostly adapted from Perl/Tk; however, this error doesn't occur on Perl/Tk because it doesn't use MouseWheelBind() on Entry widgets.
If I insist MouseWheelBind() handle any kind of scrollable widget, the challenge is determining whether a widget can do yview(). It is handled by AUTOLOAD, so I can't use $_[0]->can('yview') (try not to not do anything expensive in the callback sub anyways; hopefully it can be something done once in MouseWheelBind()). Do I really have to hardcode which widgets support yview()?