mail.tk 6.6 KB

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