#!/usr/local/bin/wish8.0jp
kanji defaultInputCode EUC

# ɥ
wm title . "Tk_find"
. configure -width 350 -height 400

# ᡼Ͽ
set icon_path "/usr/local/lib/icons"
image create photo findword -file $icon_path/find.gif
image create photo findfront -file $icon_path/findfront.gif
image create photo findboth -file $icon_path/findboth.gif
image create photo findback -file $icon_path/findback.gif
image create photo findclear -file $icon_path/clear.gif
image create photo findclose -file $icon_path/close.gif

# ʤκ
label .l0 -text " :"
entry .e0 -textvariable fname
label .l1 -text "ϥѥ :"
entry .e1 -textvariable point

## ꥹ̵ξ
button .b0 -image findword  -command {
	.t0 delete 1.0 end
	.t0 insert 1.0 [exec find $point -name $fname]
}

## ꥹդ
button .b1 -image findfront -command {
	.t0 delete 1.0 end
	.t0 insert 1.0 [exec find $point -name *$fname]
}

## ꥹξդ
button .b2 -image findboth -command {
	.t0 delete 1.0 end
	.t0 insert 1.0 [exec find $point -name *$fname*]
}

## ꥹդ
button .b3 -image findback -command {
	.t0 delete 1.0 end
	.t0 insert 1.0 [exec find $point -name $fname*]
}

## ܤ両̤򥯥ꥢ
button .b4 -image findclear -command {
	set fname ""
	set point ""
	.t0 delete 1.0 end
}

## λܥκ
button .b5 -image findclose -command "exit"

text .t0 -xscrollcommand ".s1 set" -yscrollcommand ".s2 set"
scrollbar .s1 -orient horizontal -command ".t0 xview"
scrollbar .s2 -orient vertical -command ".t0 yview"

## 쥤ȥޥɤ
place .l0 -x 5 -y 5 -width 90
place .e0 -x 95 -y 5 -width 250
place .l1 -x 5 -y 31 -width 90 
place .e1 -x 95 -y 31 -width 250

place .b0 -x 5 -y 62 -width 40 -height 40
place .b1 -x 45 -y 62 -width 40 -height 40 
place .b2 -x 85 -y 62 -width 40 -height 40
place .b3 -x 125 -y 62 -width 40 -height 40
place .b4 -x 165 -y 62 -width 40 -height 40
place .b5 -x 205 -y 62 -width 40 -height 40

place .t0 -x 20 -y 107 -width 324 -height 272
place .s1 -x 20 -y 380 -width 324 -height 16
place .s2 -x 5 -y 107 -width 16 -height 273
