Skip Menu |

This queue is for tickets about the Tcl-pTk CPAN distribution.

Report information
The Basics
Id: 129007
Status: new
Priority: 0/
Queue: Tcl-pTk

Owner: Nobody in particular
Requestors: CAC [...]

Bug Information
Severity: (no value)
Broken in: 0.96
Fixed in: (no value)

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 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()?
On Wed Apr 03 21:17:25 2019, CAC wrote:
Show quoted text
> try not to not do

I meant "try not to do"

This should also be done in a way that lets horizontal scrolling using <MouseWheel> be added. I.e., do not skip MouseWheelBind() if a widget doesn't support yview(), since it might still support xview().

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to