in u_main.tk (pd.tk), at the end of proc pdtk_canvas_new, add this:
bind $name.c <Button-4> "$name.c yview scroll -1 units" bind $name.c <Button-5> "$name.c yview scroll +1 units"
This enables the mouse wheel in patchers. Of course I will later provide a means to reconfigure it to do something else depending on what is most useful to a given user. (Some would like numberboxes to be scrollenabled, but that's conflicting with the above setting, so i'd give an option)
Mathieu Bouchard http://artengine.ca/matju
Hmm, it didn't work for me on MacOS X 10.2.8, Pd 0.37.1, and Tcl 8.4.5. It would be nice tho.
.hc
On Wednesday, Mar 24, 2004, at 00:36 America/New_York, Mathieu Bouchard wrote:
in u_main.tk (pd.tk), at the end of proc pdtk_canvas_new, add this:
bind $name.c <Button-4> "$name.c yview scroll -1 units" bind $name.c <Button-5> "$name.c yview scroll +1 units"
This enables the mouse wheel in patchers. Of course I will later provide a means to reconfigure it to do something else depending on what is most useful to a given user. (Some would like numberboxes to be scrollenabled, but that's conflicting with the above setting, so i'd give an option)
Mathieu Bouchard http://artengine.ca/matju
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
On Thu, 25 Mar 2004, Hans-Christoph Steiner wrote:
Hmm, it didn't work for me on MacOS X 10.2.8, Pd 0.37.1, and Tcl 8.4.5. It would be nice tho.
On OSX Tcl/Tk, Button-1 is left, Button-2 is right (instead of middle), Button-3 is middle (instead of right), and Button-4 and Button-5 are nothing at all, and instead you have to use <MouseWheel> events. That's what I just found. (Note that apps that run through X11, however, get the standard XFree86 button numbering)
In addition, the default behaviour for a text widget is to scroll down when the wheel goes down, but to do nothing when the wheel goes up. (!!!)
So the code that replaces this:
bind $name.c <Button-4> "$name.c yview scroll -1 units" bind $name.c <Button-5> "$name.c yview scroll +1 units"
On OSX is:
bind $name.c <MouseWheel> \
"$name.c yview scroll \[expr -abs(%D)/%D\] units"
And to fix the broken scrolling in the console, add this at the end of proc make_console (impd only):
bind .log.1 <MouseWheel> \
{.log.1 yview scroll [expr -2-abs(%D)/%D] units}
notice the -2 fudge factor... (!)
Mathieu Bouchard http://artengine.ca/matju