|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace eval ttk { |
|
|
|
variable Cursors |
|
|
|
|
|
|
|
|
|
array set Cursors { |
|
"" "" |
|
none none |
|
|
|
standard left_ptr |
|
text xterm |
|
link hand2 |
|
crosshair crosshair |
|
busy watch |
|
forbidden pirate |
|
|
|
hresize sb_h_double_arrow |
|
vresize sb_v_double_arrow |
|
|
|
nresize top_side |
|
sresize bottom_side |
|
wresize left_side |
|
eresize right_side |
|
nwresize top_left_corner |
|
neresize top_right_corner |
|
swresize bottom_left_corner |
|
seresize bottom_right_corner |
|
move fleur |
|
|
|
} |
|
|
|
|
|
|
|
switch [tk windowingsystem] { |
|
"win32" { |
|
array set Cursors { |
|
none {} |
|
|
|
standard arrow |
|
text ibeam |
|
link hand2 |
|
crosshair crosshair |
|
busy wait |
|
forbidden no |
|
|
|
vresize size_ns |
|
nresize size_ns |
|
sresize size_ns |
|
|
|
wresize size_we |
|
eresize size_we |
|
hresize size_we |
|
|
|
nwresize size_nw_se |
|
swresize size_ne_sw |
|
|
|
neresize size_ne_sw |
|
seresize size_nw_se |
|
} |
|
} |
|
|
|
"aqua" { |
|
if {[package vsatisfies [package provide Tk] 8.5]} { |
|
|
|
array set Cursors { |
|
standard arrow |
|
text ibeam |
|
link pointinghand |
|
crosshair crosshair |
|
busy watch |
|
forbidden notallowed |
|
|
|
hresize resizeleftright |
|
vresize resizeupdown |
|
nresize resizeup |
|
sresize resizedown |
|
wresize resizeleft |
|
eresize resizeright |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
proc ttk::cursor {name} { |
|
variable Cursors |
|
return $Cursors($name) |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc ttk::setCursor {w name} { |
|
variable Cursors |
|
if {[$w cget -cursor] ne $Cursors($name)} { |
|
$w configure -cursor $Cursors($name) |
|
} |
|
} |
|
|
|
|
|
|
|
proc ttk::CursorSampler {f} { |
|
ttk::frame $f |
|
|
|
set r 0 |
|
foreach row { |
|
{nwresize nresize neresize} |
|
{ wresize move eresize} |
|
{swresize sresize seresize} |
|
{text link crosshair} |
|
{hresize vresize ""} |
|
{busy forbidden ""} |
|
{none standard ""} |
|
} { |
|
set c 0 |
|
foreach cursor $row { |
|
set w $f.${r}${c} |
|
ttk::label $w -text $cursor -cursor [ttk::cursor $cursor] \ |
|
-relief solid -borderwidth 1 -padding 3 |
|
grid $w -row $r -column $c -sticky nswe |
|
grid columnconfigure $f $c -uniform cols -weight 1 |
|
incr c |
|
} |
|
grid rowconfigure $f $r -uniform rows -weight 1 |
|
incr r |
|
} |
|
|
|
return $f |
|
} |
|
|
|
if {[info exists argv0] && $argv0 eq [info script]} { |
|
wm title . "[array size ::ttk::Cursors] cursors" |
|
pack [ttk::CursorSampler .f] -expand true -fill both |
|
bind . <KeyPress-Escape> [list destroy .] |
|
focus .f |
|
} |
|
|
|
|
|
|