xref: /inferno-os/libtk/mail.tk (revision 37da2899f40661e3e9631e497da8dc59b971cbd0)
1
2# This is the first screen of the Sun mailtool
3
4# Frame .frame1 contains top-row buttons, label and entry
5# Frame .frame2 contains bottom-row buttons
6frame .frame1 -relief flat -bd 2
7frame .frame1.frame11 -relief flat -bd 2
8frame .frame1.frame12 -relief flat -bd 2
9frame .frame2 -relief flat -bd 2
10frame .frame2.frame21 -relief flat -bd 2
11frame .frame2.frame22 -relief flat -bd 2
12#frame .dummy -width 18c
13pack .frame1 .frame2 -side top -fill x
14pack .frame2.frame21 -side left -fill x
15pack .frame2.frame22 -side left -fill x
16pack .frame1.frame11 -side left -fill x
17pack .frame1.frame12 -side left -fill x
18# Scrolltext frame
19frame .frame3 -relief sunken -bd 2
20frame .frame3.frame
21
22# File View Edit Compose buttons and associated menus
23
24# Build File button
25menubutton .frame1.frame11.file -text {File} -relief raised -width 8 \ 
26        -menu {.frame1.frame11.file.menu}
27
28# Build File-menu
29menu .frame1.frame11.file.menu
30.frame1.frame11.file.menu add command \
31    -label {Load In-Box} \
32    -state {active}
33.frame1.frame11.file.menu add command \
34    -label {Print}
35.frame1.frame11.file.menu add command \
36    -label {Save Changes}
37.frame1.frame11.file.menu add command \
38    -label {Done}
39.frame1.frame11.file.menu add command \
40    -label {Mail Files...}
41
42# Build View button
43menubutton .frame1.frame11.view -text {View} -relief raised -width 8 \
44        -menu {.frame1.frame11.view.menu}
45
46# Build View-menu
47menu .frame1.frame11.view.menu
48
49.frame1.frame11.view.menu add command \
50    -label {Messages}
51.frame1.frame11.view.menu add command \
52    -label {Previous}
53.frame1.frame11.view.menu add command \
54    -label {Next} \
55    -state {active}
56.frame1.frame11.view.menu add command \
57    -label {Sort By}
58.frame1.frame11.view.menu add command \
59    -label {Find...}
60
61# Build Edit button
62menubutton .frame1.frame11.edit -text {Edit} -relief raised -width 8 \
63        -menu {.frame1.frame11.edit.menu}
64
65# Build Edit-menu
66  menu .frame1.frame11.edit.menu
67  .frame1.frame11.edit.menu add command \
68    -label {Cut}
69  .frame1.frame11.edit.menu add command \
70    -label {Copy}
71  .frame1.frame11.edit.menu add command \
72    -label {Delete}
73  .frame1.frame11.edit.menu add command \
74    -label {Undelete}
75  .frame1.frame11.edit.menu add separator
76  .frame1.frame11.edit.menu add command \
77    -label {Properties....}
78
79
80# Build Compose button
81menubutton .frame1.frame11.compose -text {Compose} -relief raised -width 12 \
82        -menu {.frame1.frame11.compose.menu}
83
84# Build Compose-menu
85  menu .frame1.frame11.compose.menu
86  .frame1.frame11.compose.menu add command \
87    -label {New}
88  .frame1.frame11.compose.menu add command \
89    -label {Reply}
90  .frame1.frame11.compose.menu add command \
91    -label {Forward}
92  .frame1.frame11.compose.menu add separator
93  .frame1.frame11.compose.menu add command \
94    -label { Vacation}
95
96# Pack the buttons File, View, Edit, Compose
97pack .frame1.frame11.file \
98    .frame1.frame11.view \
99    .frame1.frame11.edit \
100    .frame1.frame11.compose \
101     -side left
102
103update
104
105# Build Done, Next, Delete, Reply buttons and associated menus
106# Build Done button
107menubutton .frame2.frame21.done -text {Done} -relief raised  -width 8 \
108	-menu {.frame2.frame21.done.menu}
109
110# Build Done-menu (empty)
111menu .frame2.frame21.done.menu
112
113# Build Next button
114menubutton .frame2.frame21.next -text {Next} -relief raised  -width 8 \
115         -menu {.frame2.frame21.next.menu}
116
117# Build Next-menu (empty)
118menu .frame2.frame21.next.menu
119
120# Build Delete button
121menubutton .frame2.frame21.delete -text {Delete} -relief raised -width 8 \
122        -menu {.frame2.frame21.delete.menu}
123
124# Build Delete-menu (empty)
125menu .frame2.frame21.delete.menu
126
127# Build Reply button
128menubutton .frame2.frame21.reply -text {Reply} -relief raised -width 12 \
129        -menu {.frame2.frame21.reply.menu}
130
131# Build Reply-menu
132menu .frame2.frame21.reply.menu
133  .frame2.frame21.reply.menu add command \
134    -label {To Sender}
135  .frame2.frame21.reply.menu add command \
136    -label {To All}
137  .frame2.frame21.reply.menu add command \
138    -label {To Sender, Include}
139  .frame2.frame21.reply.menu add command \
140    -label {To All, Include}
141
142# Pack buttons Done, Next, Delete, Reply
143pack .frame2.frame21.done \
144    .frame2.frame21.next \
145    .frame2.frame21.delete \
146    .frame2.frame21.reply \
147     -side left
148
149update
150
151# Build buttons Move, Copy, Load and associated menus
152menubutton .frame2.frame22.move -text {Move} -relief raised -width 8 \
153        -menu {.frame2.frame22.move.menu}
154menu .frame2.frame22.move.menu
155.frame2.frame22.move.menu add command \
156    -label {Entry}
157
158menubutton .frame2.frame22.copy -text {Copy} -relief raised -width 8 \
159        -menu {.frame2.frame22.copy.menu}
160menu .frame2.frame22.copy.menu
161.frame2.frame22.copy.menu add command \
162    -label {Entry}
163
164menubutton .frame2.frame22.load -text {Load} -relief raised -width 8 \
165        -menu {.frame2.frame22.load.menu}
166menu .frame2.frame22.load.menu
167.frame2.frame22.load.menu add command \
168    -label {Entry}
169
170pack .frame2.frame22.move \
171    .frame2.frame22.copy \
172    .frame2.frame22.load \
173     -side left -fill x
174
175update
176
177# Build Mail-File label and Dir-Path entry widgets
178label .frame1.frame12.lab_mailfile -relief flat -text {Mail File:   }
179entry .frame1.frame12.entry_mailfile -width 30 -relief sunken -bd 2
180pack .frame1.frame12.entry_mailfile -side right
181pack .frame1.frame12.lab_mailfile  -side left
182
183update
184
185# Build scrolltext w/ scrollbars
186scrollbar .frame3.frame.scrollbar1 \
187	-command {.frame3.frame.listbox1 xview} \
188	-orient {horizontal} \
189    	-relief {raised}
190scrollbar .frame3.frame.scrollbar2 \
191	-command {.frame3.frame.listbox1 yview} \
192	-relief {raised}
193text .frame3.frame.listbox1 \
194	-relief {raised} \
195	-xscrollcommand {.frame3.frame.scrollbar1 set} \
196    	-yscrollcommand {.frame3.frame.scrollbar2 set}
197.frame3.frame.listbox1 insert end {Some Text}
198pack .frame3.frame
199pack .frame3.frame.scrollbar2 -side left -fill y
200pack .frame3.frame.listbox1 -side top -expand 1 -fill both
201pack .frame3.frame.scrollbar1 -side bottom -fill x
202
203# Pack frame3 to the rest of container frames
204pack .frame3 .frame3.frame -side top -expand 1 -fill both
205
206update
207
208# Build label(???) at the bottom
209label .lab_msgnum -relief flat
210pack .lab_msgnum -side top -fill x
211
212# Now make everything visible
213update
214
215# Enable keyboard traversal of a menu (Is this needed in inferno Tk?)
216#tk_menuBar .frame1.frame11 .frame1.frame11.file .frame1.frame11.view \
217        #.frame1.frame11.edit .frame1.frame11.compose
218#tk_menuBar .frame2.frame21 .frame2.frame21.done .frame2.frame21.next \
219        #.frame2.frame21.delete .frame2.frame21.reply \
220        #.frame2.frame22 .frame2.frame22.move .frame2.frame22.copy .frame2.frame22.load
221focus .frame1.frame11
222update
223
224
225