# # Bindings for ttk::panedwindow widget. # namespace eval ttk::panedwindow { variable State array set State { pressed 0 pressX - pressY - sash - sashPos - } } ## Bindings: # bind TPanedwindow <ButtonPress-1> { ttk::panedwindow::Press %W %x %y } bind TPanedwindow <B1-Motion> { ttk::panedwindow::Drag %W %x %y } bind TPanedwindow <ButtonRelease-1> { ttk::panedwindow::Release %W %x %y } bind TPanedwindow <Motion> { ttk::panedwindow::SetCursor %W %x %y } bind TPanedwindow <Enter> { ttk::panedwindow::SetCursor %W %x %y } bind TPanedwindow <Leave> { ttk::panedwindow::ResetCursor %W } # See <<NOTE-PW-LEAVE-NOTIFYINFERIOR>> bind TPanedwindow <<EnteredChild>> { ttk::panedwindow::ResetCursor %W } ## Sash movement: # proc ttk::panedwindow::Press {w x y} { variable State set sash [$w identify $x $y] if {$sash eq ""} { set State(pressed) 0 return } set State(pressed) 1 set State(pressX) $x set State(pressY) $y set State(sash) $sash set State(sashPos) [$w sashpos $sash] } proc ttk::panedwindow::Drag {w x y} { variable State if {!$State(pressed)} { return } switch -- [$w cget -orient] { horizontal { set delta [expr {$x - $State(pressX)}] } vertical { set delta [expr {$y - $State(pressY)}] } } $w sashpos $State(sash) [expr {$State(sashPos) + $delta}] } proc ttk::panedwindow::Release {w x y} { variable State set State(pressed) 0 SetCursor $w $x $y } ## Cursor management: # proc ttk::panedwindow::ResetCursor {w} { variable State if {!$State(pressed)} { ttk::setCursor $w {} } } proc ttk::panedwindow::SetCursor {w x y} { set cursor "" if {[llength [$w identify $x $y]]} { # Assume we're over a sash. switch -- [$w cget -orient] { horizontal { set cursor hresize } vertical { set cursor vresize } } } ttk::setCursor $w $cursor } #*EOF*
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
altTheme.tcl | File | 3.26 KB | 0644 |
|
aquaTheme.tcl | File | 1.95 KB | 0644 |
|
button.tcl | File | 2.91 KB | 0644 |
|
clamTheme.tcl | File | 4.16 KB | 0644 |
|
classicTheme.tcl | File | 3.44 KB | 0644 |
|
combobox.tcl | File | 12.1 KB | 0644 |
|
cursors.tcl | File | 3.91 KB | 0644 |
|
defaults.tcl | File | 3.6 KB | 0644 |
|
entry.tcl | File | 15.77 KB | 0644 |
|
fonts.tcl | File | 5.44 KB | 0644 |
|
menubutton.tcl | File | 4.77 KB | 0644 |
|
notebook.tcl | File | 5.49 KB | 0644 |
|
panedwindow.tcl | File | 1.88 KB | 0644 |
|
progress.tcl | File | 1.06 KB | 0644 |
|
scale.tcl | File | 2.49 KB | 0644 |
|
scrollbar.tcl | File | 3.02 KB | 0644 |
|
sizegrip.tcl | File | 2.34 KB | 0644 |
|
spinbox.tcl | File | 4.16 KB | 0644 |
|
treeview.tcl | File | 8.66 KB | 0644 |
|
ttk.tcl | File | 4.44 KB | 0644 |
|
utils.tcl | File | 8.36 KB | 0644 |
|
vistaTheme.tcl | File | 9.13 KB | 0644 |
|
winTheme.tcl | File | 2.58 KB | 0644 |
|
xpTheme.tcl | File | 1.88 KB | 0644 |
|