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

People
Owner: Nobody in particular
Requestors: CAC [...] cpan.org
Cc:
AdminCc:

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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-7121-1554344245-1483.0-0-0 [...] rt.cpan.org>
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 4725
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()?
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-7121-1554344245-1483.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-7121-1554344245-1483.0-0-0 [...] rt.cpan.org>
Content-Type: text/html; charset="utf-8"
Message-ID: <rt-4.0.18-15966-1554344769-960.129007-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 666
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 Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.