comparison contrib/hgk @ 4968:713426631adf

hgk: enable mouse wheel on MouseWheel events. At this point, mouse wheel still does not work under Windows.
author Patrick Mezard <pmezard@gmail.com>
date Sun, 22 Jul 2007 16:21:49 +0200
parents 4a84f7421692
children b43db44cd047
comparison
equal deleted inserted replaced
4967:cf67b5f3743d 4968:713426631adf
295 foreach d $dirs { 295 foreach d $dirs {
296 set dir [file tail $d] 296 set dir [file tail $d]
297 if {[lsearch -exact $excl $dir] >= 0} continue 297 if {[lsearch -exact $excl $dir] >= 0} continue
298 readotherrefs [file join $base $dir] "$dname$dir/" {} 298 readotherrefs [file join $base $dir] "$dname$dir/" {}
299 } 299 }
300 }
301
302 proc allcansmousewheel {delta} {
303 set delta [expr -5*(int($delta)/abs($delta))]
304 allcanvs yview scroll $delta units
300 } 305 }
301 306
302 proc error_popup msg { 307 proc error_popup msg {
303 set w .error 308 set w .error
304 toplevel $w 309 toplevel $w
468 473
469 pack .ctop -side top -fill both -expand 1 474 pack .ctop -side top -fill both -expand 1
470 475
471 bindall <1> {selcanvline %W %x %y} 476 bindall <1> {selcanvline %W %x %y}
472 #bindall <B1-Motion> {selcanvline %W %x %y} 477 #bindall <B1-Motion> {selcanvline %W %x %y}
478 bindall <MouseWheel> "allcansmousewheel %D"
473 bindall <ButtonRelease-4> "allcanvs yview scroll -5 units" 479 bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
474 bindall <ButtonRelease-5> "allcanvs yview scroll 5 units" 480 bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
475 bindall <2> "allcanvs scan mark 0 %y" 481 bindall <2> "allcanvs scan mark 0 %y"
476 bindall <B2-Motion> "allcanvs scan dragto 0 %y" 482 bindall <B2-Motion> "allcanvs scan dragto 0 %y"
477 bind . <Key-Up> "selnextline -1" 483 bind . <Key-Up> "selnextline -1"