-
Notifications
You must be signed in to change notification settings - Fork 1
/
title.wish
executable file
·77 lines (60 loc) · 1.91 KB
/
title.wish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/wish
package require Tclx
set background white
set a test
wm geometry . "1280x1024"
. configure -bg #fff
image create photo im -file "img/bukkyo.png"
image create photo bg -file "img/backgroundDefault.png"
canvas .c -width 1280 -height 1024 -background #fff -borderwidth 0 -highlightthickness 0
.c create image 640 312 -image bg
.c create image 640 100 -image im
pack .c
#canvas .f1.g -width 1280 -background #fff -borderwidth 0 -highlightthickness 0
#.f1.g create image 1280 924 -image bg
frame .f2 -background #fff -borderwidth 0 -highlightthickness 0
label .l1 -textvariable userid -height 1 -font {{MMCedar} 24} -background #fff -borderwidth 0 -highlightthickness 0
label .l2 -textvariable username -height 2 -font {{MMcedar} 32} -background #fff -borderwidth 0 -highlightthickness 0
label .l3 -textvariable balance -height 2 -font {{MMcedar} 20} -background #fff -borderwidth 0 -highlightthickness 0
pack .l1 .l2 .l3 -in .f2
entry .barcode -textvariable item -validate key -validatecommand {
return [string is integer %P] * [expr ([string length %P] > 14) ? 0 : 1]
}
button .buttonexit -text "exit" -command "exec killall run_bukkyo.sh"
bind .barcode <Key-Return> {
set a $item
set item ""
exec kill -USR1 [lindex $argv 0]
}
#pack .f3.e1
#pack .f4.b1
#pack .c .l1 .l2 .l3 .e1 .b1
.c create window 640 812 -window .f2 -width 1280 -height 250
.c create window 60 50 -window .barcode -width 30 -height 10
.c create window 1000 200 -window .buttonexit -width 100 -height 40
raise .
focus .barcode
set userid ""
set username ""
set balance ""
set dum ""
proc writename {} {
eval exec "echo signal >> hoge"
gets stdin ::userid
gets stdin ::username
gets stdin ::balance
}
proc clearname {} {
eval exec "echo reshow >> hoge"
set ::userid ""
set ::username ""
set ::balance ""
}
proc send_item {} {
global a
puts $a
flush stdout
}
signal trap USR1 writename
signal trap USR2 clearname
signal trap PIPE send_item