UPS: apcupsd clean sources
[tomato.git] / release / src / router / apcupsd / examples / gui / apcupsd.tcl
blob48bb7a28b1d07d77a069f8b2c85fba72c713a25f
2 # Apcupsd Graphic Interface
3 #
5 proc MessageBox {msg type} {
6 tk_messageBox -icon $type -message $msg
9 proc ExitCmd {} {
10 exit 0
13 proc RefreshCmd {} {
14 GetStatus
15 destroy .main.text
16 destroy .main.image1
17 destroy .main.image2
18 destroy .main.image3
19 DisplayStatus
20 GetEvents
21 update
24 proc HelpCmd {} {
25 exec netscape www.sibbald.com/apcupsd/manual/ &
28 wm title . "Apcupsd"
29 # wm minsize . 600 390
31 foreach File [list \
32 mainwindow.tcl \
33 about.tcl \
34 dialog.tcl \
35 splash.tcl \
36 status.tcl \
37 events.tcl \
38 ] {
39 if {![file exists "$File"]} {
40 puts "Unable to find required source file $File"
41 exit 1
42 } else {
43 source $File
46 unset File
48 DisplaySplash
49 CreateMainWindow
50 GetStatus
51 DisplayStatus
52 GetEvents
53 update
54 after 1000
55 destroy .splash
56 wm deiconify .