UPS: apcupsd clean sources
[tomato.git] / release / src / router / apcupsd / examples / gui / mainwindow.tcl
blob2db2078bfd7b51ca6f5c08d3193a2f130f2545c2
1 proc CreateMainWindow {} {
2 global statustext StatusText
3 set StatusText " Ready ..."
4 . configure -menu .mbar
5 menu .mbar
6 .mbar add cascade -label "File" -underline 0 -menu .mbar.file
7 menu .mbar.file
9 .mbar.file add separator
10 .mbar.file add command -label "Exit" -underline 0 -command {ExitCmd}
12 .mbar add cascade -label "Options" -underline 0 -menu .mbar.options
13 menu .mbar.options
14 .mbar.options add command -label "Refresh Now" -underline 0 -command {RefreshCmd}
16 .mbar add cascade -label "Help" -underline 0 -menu .mbar.help
17 menu .mbar.help
18 .mbar.help add command -label "About Apcupsd" -underline 0 -command {AboutCmd}
19 .mbar.help add command -label "Help" -underline 0 -command {HelpCmd}
21 frame .sep1 -height 10 -borderwidth 0
22 pack .sep1 -fill x -side top
23 text .sep1.text -relief groove -height 1
24 .sep1.text configure -tabs {2.5i 4.5i 6.5i}
25 .sep1.text insert end "\tBattery V\tMains V\tMains V"
26 pack .sep1.text -side top -fill x
28 frame .main -borderwidth 0
29 pack .main -side top -fill x
31 frame .sep2 -height 2 -borderwidth 1 -relief sunken
32 pack .sep2 -fill x -pady 4
34 frame .elab
35 pack .elab -side top -fill x
36 label .elab.lab1 -text "Events:" -anchor e
37 pack .elab.lab1 -side left -padx 4
39 frame .events
40 pack .events -fill x -padx 4 -pady 4
42 scrollbar .events.sbar -command ".events.text yview"
43 pack .events.sbar -side right -fill y
44 text .events.text -height 10 -wrap word -yscrollcommand ".events.sbar set"
45 pack .events.text -side top -fill x
47 frame .status -borderwidth 1 -relief raised
48 pack .status -side bottom -fill x -pady 2
49 label .statusLabel -text "Status:" -anchor e -fg magenta
50 set statustext [label .statusText -relief sunken \
51 -borderwidth 1 -textvariable StatusText -anchor w]
52 grid columnconfigure .status 1 -weight 1
53 grid .statusLabel -in .status -row 0 -column 0
54 grid .statusText -in .status -row 0 -column 1 -sticky ew -padx 3