7.17. Scrolling Methods
The listbox can be scrolled both horizontally and vertically so it has both xview and yview methods and all their associated forms. These forms and how to use them are described in detail in Chapter 6.
The scan method allows you to use a really fast scrolling method. It is automatically bound to the second mouse button by the listbox. Here is how you can do the same thing within your window:
$mw->bind("Listbox", "<2>",['scan','mark',Ev('x'),Ev('y')]);
$mw->bind("Listbox", "<B2-Motion>",['scan','dragto',Ev('x'),Ev('y')]);
When you click in the window with the second mouse button and then move your mouse around, you'll see the contents of the listbox zip by at super-fast speed. You could change the second argument of each bind statement if you wanted to bind this to another combination of keys/mouse actions. The bind method is explained in Chapter 14.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access