home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / tcl / xf2.3-p / xf2 / xf2.3 / xftutorial / script.xf / working.scrpt < prev   
Encoding:
Text File  |  1993-11-20  |  6.4 KB  |  176 lines

  1. # tutorial
  2. global workingLast
  3. set workingLast 8
  4. global workingLastSectionDone
  5. set workingLastSectionDone -1
  6.  
  7.  
  8. set workingName0 {Working with XF}
  9. set workingText0 {\
  10. After starting XF you see an empty toplevel window, and
  11. a second toplevel with a menubar and some lists. The
  12. empty toplevel window is your workspace, where you
  13. build your main dialog window. The second window is the
  14. XF main edit window. This window gives you access to
  15. all features of XF.
  16.  
  17. XF works as a WYSIWYG tool (argh... :-). Probably I
  18. should name it WYSIWII (What you see is what it is).
  19. Your workspace is exactly (well almost exactly) your
  20. application. If you press a button the button action
  21. is called as if the program would run without XF.}
  22.  
  23.  
  24. set workingName1 {The XF main edit window}
  25. set workingText1 {\
  26. The main edit window is split horizontally into
  27. several parts. At the top of the window you see a
  28. menubar where you can activate many features of XF.
  29. Directly beyond this menubar you see a status line,
  30. that is currently empty. Right beside this status
  31. line you see the status of the cut buffer. Now
  32. follows the current widget path. This widget path
  33. is the name of the widget that is currently
  34. selected. All actions (like inserting a new widget,
  35. calling the widget configuration etc.) affect
  36. this widget. Below the widget path you see three
  37. lists. The items in the left list represent
  38. widget classes that are part of the Tk distribution.
  39. The middle list represents additional widget
  40. classes that are available as extensions to the
  41. standard Tk widget set. They require a modified
  42. Tk command interpreter. The right list represents
  43. complex widget structures, that form some kind of
  44. dialog element. These elements are called
  45. "templates". Below this list you see the name of
  46. the class that is currently selected. By pressing
  47. one of the two buttons below this class name you
  48. insert a widget of this class into your application.
  49. The left button "Add with defaults" directly inserts
  50. the widget class. The right button "Add and
  51. configure" calls the parameter window for the widget
  52. class, where you can set the parameters for the widget
  53. and the name of the widget.}
  54.  
  55.  
  56. set workingName2 {Inserting widgets}
  57. set workingText2 {\
  58. As described above, you can insert widgets into your
  59. application by pressing one of the two buttons in 
  60. the main edit window of XF. If you set the scale to
  61. a number different than one, you can insert these
  62. much widgets at once. To insert a widget with default
  63. parameters you can double click with the left mouse
  64. button directly onto the widget class you want to
  65. insert. To insert a widget and configure it you can
  66. double click with the right mouse button.}
  67.  
  68.  
  69. set workingName3 {Setting widget parameters}
  70. set workingText3 {\
  71. To change the parameters of a widget after it was
  72. inserted, you can select the menu item "Parameters"
  73. in the "Configuration" menu. This activates the
  74. parameters setting dialog for the currently
  75. selected widget. To call the parameter setting
  76. dialog directly you double click the right mouse
  77. button over the widget in your application.
  78.  
  79. The parameter dialog box allows you to set the
  80. different parameters for the widgets. Each
  81. widget class has it's own parameter dialog.
  82. This allows you to set the specific parameters
  83. for the widget. This may be i.e. the foreground
  84. color or the font. When we specify the
  85. functionality (i.e. for buttons) we will do this
  86. with the "command" parameter. For some parameters 
  87. (like color, font etc.) there are additional
  88. dialog boxes, that can be called by double
  89. clicking the right mouse button over the entry
  90. field that holds the parameter.}
  91.  
  92.  
  93. set workingName4 {Layouting with the packer}
  94. set workingText4 {\
  95. To define a layout for the different widgets you
  96. can use the packer and/or the placer. To see a
  97. detailed description of these layout methods take
  98. a look on the chapters describing them.
  99.  
  100. Here I only give a short survey of the packer.
  101. The packer is activated by calling the menu item
  102. "Packer" in the "Configuration" menu. You get a
  103. window with a number of buttons at the top. Two
  104. sliders followed by two lists and three lines
  105. of buttons at the bottom. This window gives you
  106. full access to the packing of Tk. In the left
  107. list you see all widgets that are children of the
  108. current toplevel (the toplevel that contains the
  109. currently configured widget). The right list
  110. contains the children of the currently configured
  111. widget. You can specify the packing options for
  112. each children by selecting it in the right list
  113. and setting the options above the list to the
  114. values you want. Each setting you make directly
  115. results in a relayout of the widget in your
  116. application.}
  117.  
  118.  
  119. set workingName5 {Procedures}
  120. set workingText5 {\
  121. To add procedures to your application, you
  122. activate the menu item "Procedures" in the
  123. "Programming" menu. What you see now is a
  124. list of all known procedures. Now you can
  125. add, modify, rename etc. procedures by
  126. pressing the appropriate button.}
  127.  
  128.  
  129. set workingName6 {Startup/End source}
  130. set workingText6 {\
  131. If your application needs control when your
  132. program is started (i.e. to parse the argument
  133. list or to set the contents of a list at
  134. startup), you can use the startup/end source.
  135. The startup source is executed as first
  136. source of the complete application. The end
  137. source is executed right before the flow 
  138. control of the program is given to the main
  139. loop. To define the startup source you select
  140. the menu item "Startup source" in the menu
  141. "Programming".}
  142.  
  143.  
  144. set workingName7 {Cut/paste and templates}
  145. set workingText7 {\
  146. XF provides a cut and paste mechanism, that allows
  147. you to cut any widget structure and paste it into
  148. your application at any point you wish. The only
  149. restriction is, that you cannot cut ".". The current
  150. cut buffer can be displayed as the Tcl/Tk code that
  151. builds the widget structure or as the widget
  152. structure itself.
  153.  
  154. You can save the cut buffer to a file. Saving the
  155. cut buffer as a template is a special case of this
  156. saving. A template is a cutbuffer (can be more,
  157. but that's for experts :-), that is saved to a
  158. special location (the template directory).}
  159.  
  160.  
  161. set workingName8 {Toplevels}
  162. set workingText8 {\
  163. If your program contains more than one toplevel,
  164. you probably want to hide some of them when your
  165. program is started. This can be done with the
  166. pull down menu that is attached to the label
  167. "Current widget path:" in the main edit window
  168. of XF. To display a toplevel window you call the
  169. procedure ShowWindow.toplevel, where "toplevel"
  170. is the name of the toplevel. To remove a
  171. toplevel you call the procedure
  172. DestroyWindow.toplevel, where "toplevel"
  173. is the name of the toplevel.}
  174.  
  175.  
  176.