1#
2# apcctrl Graphic Interface
3#
4
5proc MessageBox {msg type} {
6   tk_messageBox -icon $type -message $msg
7}
8
9proc ExitCmd {} {
10   exit 0
11}
12
13proc 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
22}
23
24proc HelpCmd {} {
25   exec netscape www.sibbald.com/apcctrl/manual/ &
26}
27
28wm title . "apcctrl"
29# wm minsize . 600 390
30
31foreach 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
44      }
45}
46unset File
47
48DisplaySplash
49CreateMainWindow
50GetStatus
51DisplayStatus
52GetEvents
53update
54after 1000
55destroy .splash
56wm deiconify .
57
58