__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#
# Bindings for Buttons, Checkbuttons, and Radiobuttons.
#
# Notes: <Button1-Leave>, <Button1-Enter> only control the "pressed"
# state; widgets remain "active" if the pointer is dragged out.
# This doesn't seem to be conventional, but it's a nice way
# to provide extra feedback while the grab is active.
# (If the button is released off the widget, the grab deactivates and
# we get a <Leave> event then, which turns off the "active" state)
#
# Normally, <ButtonRelease> and <ButtonN-Enter/Leave> events are
# delivered to the widget which received the initial <Button>
# event. However, Tk [grab]s (#1223103) and menu interactions
# (#1222605) can interfere with this. To guard against spurious
# <Button1-Enter> events, the <Button1-Enter> binding only sets
# the pressed state if the button is currently active.
#
namespace eval ttk::button {}
bind TButton <Enter> { %W instate !disabled {%W state active} }
bind TButton <Leave> { %W state !active }
bind TButton <space> { ttk::button::activate %W }
bind TButton <<Invoke>> { ttk::button::activate %W }
bind TButton <Button-1> \
{ %W instate !disabled { ttk::clickToFocus %W; %W state pressed } }
bind TButton <ButtonRelease-1> \
{ %W instate pressed { %W state !pressed; %W instate !disabled { %W invoke } } }
bind TButton <Button1-Leave> \
{ %W state !pressed }
bind TButton <Button1-Enter> \
{ %W instate {active !disabled} { %W state pressed } }
# Checkbuttons and Radiobuttons have the same bindings as Buttons:
#
ttk::copyBindings TButton TCheckbutton
ttk::copyBindings TButton TRadiobutton
# ...plus a few more:
bind TRadiobutton <Up> { ttk::button::RadioTraverse %W -1 }
bind TRadiobutton <Down> { ttk::button::RadioTraverse %W +1 }
# bind TCheckbutton <plus> { %W select }
# bind TCheckbutton <minus> { %W deselect }
# activate --
# Simulate a button press: temporarily set the state to 'pressed',
# then invoke the button.
#
proc ttk::button::activate {w} {
$w instate disabled { return }
set oldState [$w state pressed]
update idletasks; after 100 ;# block event loop to avoid reentrancy
$w state $oldState
$w invoke
}
# RadioTraverse -- up/down keyboard traversal for radiobutton groups.
# Set focus to previous/next radiobutton in a group.
# A radiobutton group consists of all the radiobuttons with
# the same parent and -variable; this is a pretty good heuristic
# that works most of the time.
#
proc ttk::button::RadioTraverse {w dir} {
set group [list]
foreach sibling [winfo children [winfo parent $w]] {
if { [winfo class $sibling] eq "TRadiobutton"
&& [$sibling cget -variable] eq [$w cget -variable]
&& ![$sibling instate disabled]
} {
lappend group $sibling
}
}
if {![llength $group]} { # Shouldn't happen, but can.
return
}
set pos [expr {([lsearch -exact $group $w] + $dir) % [llength $group]}]
tk::TabToWindow [lindex $group $pos]
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| altTheme.tcl | File | 4.65 KB | 0644 |
|
| aquaTheme.tcl | File | 3.6 KB | 0644 |
|
| button.tcl | File | 2.86 KB | 0644 |
|
| clamTheme.tcl | File | 5.78 KB | 0644 |
|
| classicTheme.tcl | File | 4.13 KB | 0644 |
|
| combobox.tcl | File | 11.97 KB | 0644 |
|
| cursors.tcl | File | 4.36 KB | 0644 |
|
| defaults.tcl | File | 4.74 KB | 0644 |
|
| entry.tcl | File | 16.96 KB | 0644 |
|
| fonts.tcl | File | 5.35 KB | 0644 |
|
| menubutton.tcl | File | 6.03 KB | 0644 |
|
| notebook.tcl | File | 5.53 KB | 0644 |
|
| panedwindow.tcl | File | 2.02 KB | 0644 |
|
| progress.tcl | File | 1.06 KB | 0644 |
|
| scale.tcl | File | 2.63 KB | 0644 |
|
| scrollbar.tcl | File | 3.08 KB | 0644 |
|
| sizegrip.tcl | File | 2.34 KB | 0644 |
|
| spinbox.tcl | File | 4.7 KB | 0644 |
|
| treeview.tcl | File | 9.57 KB | 0644 |
|
| ttk.tcl | File | 5.19 KB | 0644 |
|
| utils.tcl | File | 8.09 KB | 0644 |
|
| vistaTheme.tcl | File | 10.19 KB | 0644 |
|
| winTheme.tcl | File | 3.65 KB | 0644 |
|
| xpTheme.tcl | File | 2.93 KB | 0644 |
|