wm title . {新しいタイトル} |
wm protocol . WM_DELETE_WINDOW {exit} |
option add *Font {{MS 明朝} 10} |
proc busy {sw} { global cursor if {$sw == "on"} { foreach child [winfo children .] { set cursor(c$child) [$child cget -cursor] $child configure -cursor watch } } else { foreach child [winfo children .] { $child configure -cursor $cursor(c$child) } } } busy on # 時間のかかる処理 busy off |
switch $tcl_platform(platform) { windows {} unix {} macintosh {} default {} } |
parray tcl_platform =>tcl_platform(byteOrder) = littleEndian =>tcl_platform(machine) = intel =>tcl_platform(os) = Windows 95 =>tcl_platform(osVersion) = 4.0 =>tcl_platform(platform) = windows =>tcl_platform(user) = s-imai |
parray env =>env(HOME) = c:\ =>env(TEMP) = c:\temp =>env(PATH) = ... |
clock format [clock scan "2 monday" -base [clock scan 1/1/2000]] -format "%D" ==>01/10/00 |
pack [listbox .l -bg SystemWindow] |
pack [text .t] .t insert end {ここをセレクションしてください。} .t tag add foo 1.0 1.end .t tag configure foo -background red -foreground green .t tag raise sel foo ;# この行があるとないとで大違い |
selection clear selection get selection own |
proc Copy w { if {![catch {set data [$w get sel.first sel.last]}]} { clipboard clear -displayof $w clipboard append -displayof $w $data } } proc Cut w { if {![catch {set data [$w get sel.first sel.last]}]} { clipboard clear -displayof $w clipboard append -displayof $w $data $w delete sel.first sel.last } } proc Paste w { global tcl_platform catch { if {[string compare $tcl_platform(platform) "unix"]} { catch { $w delete sel.first sel.last } } $w insert insert [selection get -displayof $w -selection CLIPBOARD] } } |
exec $env(COMSPEC) /c start c:/sample.html & |
source "./balloon.tcl" option add *highlightThickness 0 label .head -text "move the pointer\nhere" -relief groove label .suite -text "another balloon here" -relief groove button .bye -text "Quit" -command exit pack .head -side top -fill x -pady 10 -padx 10 pack .suite .bye -side right -pady 10 -padx 10 pack .bye -side bottom -pady 10 -padx 10 set_balloon .head "first balloon" set_balloon .suite "second balloon" set_balloon .bye "bye bye" |