home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tut / tkc.ppres < prev    next >
Encoding:
Text File  |  1993-02-02  |  47.2 KB  |  1,048 lines

  1. # ppres data_file
  2.  
  3. # This file contains a presentation prepared by
  4. # Perspecta Presents 1.09
  5.  
  6. dictdefine itemlook Drawing -fg Black -lp Solid -bg White -fp Solid -width 1.00 -dash solid -arrow none -feather White -dir 0
  7. dictdefine itemlook Arrows -fg Black -lp Solid -bg White -fp Solid -width 1.00 -dash solid -arrow head -feather White -dir 0
  8. dictdefine itemlook TextBox -fg None -lp Solid -bg None -fp Solid -width 1.00 -dash solid -arrow none -feather Black -dir 0
  9. dictdefine paralook Title -family Times -color Blue -pointsize 36 -bold 1 -italic 0 -underline 0 -left 0.00 -indent 0.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.20 -linespacetype 1 -paraspace 1.20 -paraspacetype 1 -justify left -tabs {} -powertext None
  10. dictdefine paralook Text -family Times -color Black -pointsize 24 -bold 0 -italic 0 -underline 0 -left 0.00 -indent 0.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.00 -linespacetype 1 -paraspace 1.00 -paraspacetype 1 -justify left -tabs { 36 72 108 144 180 216 252 288 324 360 396} -powertext None
  11. dictdefine paralook Heading -family Times -color Black -pointsize 24 -bold 1 -italic 0 -underline 0 -left 0.00 -indent 0.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.20 -linespacetype 1 -paraspace 1.50 -paraspacetype 1 -justify left -tabs { 36 72 108 144 180 216 252 288 324 360 396} -powertext None
  12. dictdefine paralook Subheading -family Times -color Black -pointsize 24 -bold 0 -italic 0 -underline 0 -left 36.00 -indent 0.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.20 -linespacetype 1 -paraspace 1.50 -paraspacetype 1 -justify left -tabs { 36 72 108 144 180 216 252 288 324 360 396} -powertext None
  13. dictdefine paralook BHeading -family Times -color Black -pointsize 24 -bold 0 -italic 0 -underline 0 -left 18.00 -indent -18.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.20 -linespacetype 1 -paraspace 1.50 -paraspacetype 1 -justify left -tabs { 18 54 90 126 162 198 234 270 306 342 378 414} -powertext Bullets
  14. dictdefine paralook BSubheading -family Times -color Black -pointsize 24 -bold 0 -italic 0 -underline 0 -left 54.00 -indent -18.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.20 -linespacetype 1 -paraspace 1.50 -paraspacetype 1 -justify left -tabs { 54 90 126 162 198 234 270 306 342 378 414} -powertext Bullets
  15. dictdefine paralook I.Heading -family Times -color Black -pointsize 24 -bold 1 -italic 0 -underline 0 -left 36.00 -indent -36.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.20 -linespacetype 1 -paraspace 1.50 -paraspacetype 1 -justify left -tabs { 36 72 108 144 180 216 252 288 324 360 396} -powertext Roman
  16. dictdefine paralook 1.Heading -family Times -color Black -pointsize 24 -bold 0 -italic 0 -underline 0 -left 36.00 -indent -36.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.20 -linespacetype 1 -paraspace 1.50 -paraspacetype 1 -justify left -tabs { 36 72 108 144 180 216 252 288 324 360 396} -powertext None
  17. dictdefine paralook A.Subheading -family Times -color Black -pointsize 24 -bold 0 -italic 0 -underline 0 -left 63.00 -indent -27.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.20 -linespacetype 1 -paraspace 1.50 -paraspacetype 1 -justify left -tabs { 72 108 144 180 216 252 288 324 360 396} -powertext Letters
  18. dictdefine paralook 1.Subheading -family Times -color Black -pointsize 24 -bold 0 -italic 0 -underline 0 -left 90.00 -indent -27.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.20 -linespacetype 1 -paraspace 1.50 -paraspacetype 1 -justify left -tabs { 108 144 180 216 252 288 324 360 396} -powertext None
  19. dictdefine paralook (a)Subheading -family Times -color Black -pointsize 24 -bold 0 -italic 0 -underline 0 -left 126.00 -indent -36.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.20 -linespacetype 1 -paraspace 1.50 -paraspacetype 1 -justify left -tabs { 144 180 216 252 288 324 360 396} -powertext Letters(lc)
  20. dictdefine paralook i.Subheading -family Times -color Black -pointsize 24 -bold 0 -italic 0 -underline 0 -left 162.00 -indent -36.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.20 -linespacetype 1 -paraspace 1.50 -paraspacetype 1 -justify left -tabs { 180 216 252 288 324 360 396} -powertext Roman(lc)
  21. dictdefine paralook Code -family Courier -color Green -pointsize 24 -bold 1 -italic 0 -underline 0 -left 36.00 -indent 0.00 -right 0.00 -top 0.00 -bottom 0.00 -linespace 1.00 -linespacetype 1 -paraspace 1.00 -paraspacetype 1 -justify left -tabs { 36 72 108 144 180 216 252 288 324 360 396} -powertext None
  22. dictdefine color Black #000000
  23. dictdefine color White #ffffff
  24. dictdefine color Red #ff0000
  25. dictdefine color Orange #ffa500
  26. dictdefine color Yellow #ffff00
  27. dictdefine color Green #00ff00
  28. dictdefine color Blue #00bfff
  29. dictdefine color Purple #ca00e1
  30. dictdefine color Grey #c0c0c0
  31. talk itemconfig  -look Drawing -fg Black -bg None -fp Solid -width 1.00 -arrow none -feather White -dir 90
  32. talk textconfig  -look TextBox
  33. talk paraconfig  -look BHeading
  34. set talk(textUnits) i
  35. set talk(featherSwatches) 16
  36. set talk(noteOrientation) v
  37. set talk(backgOrientation) v
  38. set talk(featherPrint) 1
  39. set talk(gridGridi) 8
  40. set talk(windowZoom) 1
  41. set talk(pointsize) {8 10 12 14 18 20 22 24 36}
  42. set talk(grid) 9
  43. set talk(textGridc) 5
  44. set talk(pagesize) {612 792}
  45. set talk(gridUnits) i
  46. set talk(textGridi) 8
  47. set talk(featherBlend) color
  48. set talk(spacing) {0.00 0.50 1.00 1.2 1.50 1.75 2.00 2.5 3.00 4.0}
  49. set talk(featherDisplay) 1
  50. set talk(printLevel) 2
  51. set talk(customUnits) i
  52. set talk(gridGridc) 5
  53. view active 1backg
  54. orientation - v
  55. set ti [new - title "54 95 558 140.956" -look TextBox];
  56. tiformat $ti 0 0 0 1 -revert 1;
  57. insert $ti shift -revert 1;
  58. tlconfig $ti cursor  -look Title -justify center;
  59. insert $ti shift -revert 1;
  60. insert $ti shift -color Blue;
  61. insert $ti shift -string "Title"  -color Blue;
  62. tiformat $ti 0 5 0 6 -color Blue;
  63. set ti;
  64.  
  65. view active 2backg
  66. orientation - v
  67. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  68. tiformat $ti 0 0 0 1 -revert 1;
  69. insert $ti shift -revert 1;
  70. tlconfig $ti cursor  -look Title;
  71. insert $ti shift -revert 1;
  72. insert $ti shift -string "Title" ;
  73. set ti;
  74. new - rectangle "27 108 585 114.75" -look Drawing -fg None -bg Blue -fp Blend -width 0.50 -feather White -dir 90
  75. set ti [new - textitem "387 702 585 718.004" -look TextBox];
  76. tiformat $ti 0 0 0 1 -revert 1;
  77. insert $ti shift -revert 1;
  78. tlconfig $ti cursor  -look Text -justify right;
  79. insert $ti shift -revert 1;
  80. insert $ti shift -family Helvetica -pointsize 12;
  81. insert $ti shift -string "Tk C Interfaces, slide "  -family Helvetica -pointsize 12;
  82. set id [PowerCreate 1 $ti cursor {Page Number} Numbers { -family Helvetica -pointsize 12} -1 { 13 }];
  83. insert $ti shift -string "."  -family Helvetica -pointsize 12;
  84. tiformat $ti 0 28 0 29 -pointsize 12;
  85. set ti;
  86.  
  87. view active 1slide
  88. backg - 1
  89. set ti [new - title "27 140 585 241.0288" -look TextBox];
  90. tiformat $ti 0 0 0 1 -revert 1;
  91. insert $ti shift -revert 1;
  92. tlconfig $ti cursor  -look Title -justify center;
  93. insert $ti shift -revert 1;
  94. insert $ti shift -string "Writing A New Widget Class" ;
  95. insertPara $ti shift ;
  96. insert $ti shift -string "Using C and Tk" ;
  97. set ti;
  98. set ti [new - textitem "27 423 585 636.824" -look TextBox];
  99. tiformat $ti 0 0 0 1 -revert 1;
  100. insert $ti shift -revert 1;
  101. tlconfig $ti cursor  -look Heading -paraspace 1.00 -justify center;
  102. insert $ti shift -revert 1;
  103. insert $ti shift -color Red -bold 0 -italic 0 -underline 0;
  104. insert $ti shift -string "John Ousterhout"  -color Red -bold 0 -italic 0 -underline 0;
  105. insertPara $ti shift ;
  106. insertPara $ti shift  -color -1;
  107. insertPara $ti shift ;
  108. insert $ti shift -string "Computer Science Division"  -bold 0 -italic 0 -underline 0;
  109. insertPara $ti shift ;
  110. insert $ti shift -string "Department of EECS"  -bold 0 -italic 0 -underline 0;
  111. insertPara $ti shift ;
  112. insertPara $ti shift ;
  113. insert $ti shift -string "University of California at Berkeley"  -bold 0 -italic 0 -underline 0;
  114. tiformat $ti 6 36 6 37 -bold 0 -italic 0 -underline 0;
  115. set ti;
  116. set ti [new - textitem "81 270 126 301.304" -look TextBox];
  117. tiformat $ti 0 0 0 1 -revert 1;
  118. insert $ti shift -revert 1;
  119. tlconfig $ti cursor  -look Heading;
  120. insert $ti shift -revert 1;
  121. set ti;
  122.  
  123. view active 1note
  124. orientation - v
  125. icon - 100.45455 40 0.67171717
  126.  
  127. view active 2slide
  128. backg - 2
  129. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  130. tiformat $ti 0 0 0 1 -revert 1;
  131. insert $ti shift -revert 1;
  132. tlconfig $ti cursor  -look Title;
  133. insert $ti shift -revert 1;
  134. insert $ti shift -string "Outline" ;
  135. set ti;
  136. set ti [new - textitem "45 153 585 629.7776" -look TextBox];
  137. tiformat $ti 0 0 0 1 -revert 1;
  138. insert $ti shift -revert 1;
  139. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  140. insert $ti shift -revert 1;
  141. insert $ti shift -string "What does Tk do for widget writers?" ;
  142. insertPara $ti shift ;
  143. tlconfig $ti cursor -plook { -color Red} -paraspace 2.50;
  144. insert $ti shift -string "Widget basics: data structures, etc." ;
  145. insertPara $ti shift ;
  146. tlconfig $ti cursor -plook { -color Red};
  147. insert $ti shift -string "Six procedures to write:" ;
  148. insertPara $ti shift ;
  149. tlconfig $ti cursor  -look Subheading;
  150. insert $ti shift -string "-  Create" ;
  151. insertPara $ti shift ;
  152. insert $ti shift -string "-  Configure" ;
  153. insertPara $ti shift ;
  154. insert $ti shift -string "-  Display" ;
  155. insertPara $ti shift ;
  156. insert $ti shift -string "-  Widget command" ;
  157. insertPara $ti shift ;
  158. insert $ti shift -string "-  Event handler" ;
  159. insertPara $ti shift ;
  160. insert $ti shift -string "-  Destroy" ;
  161. insertPara $ti shift ;
  162. tlconfig $ti cursor -plook { -color Red} -look BHeading -paraspace 2.50;
  163. insert $ti shift -string "Example: trivial ``square'' widget." ;
  164. set ti;
  165.  
  166. view active 3slide
  167. backg - 2
  168. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  169. tiformat $ti 0 0 0 1 -revert 1;
  170. insert $ti shift -revert 1;
  171. tlconfig $ti cursor  -look Title;
  172. insert $ti shift -revert 1;
  173. insert $ti shift -string "What Does Tk Do For You?" ;
  174. set ti;
  175. set ti [new - textitem "45 153 585 657.2288" -look TextBox];
  176. tiformat $ti 0 0 0 1 -revert 1;
  177. insert $ti shift -revert 1;
  178. tlconfig $ti cursor  -look 1.Heading;
  179. insert $ti shift -revert 1;
  180. insert $ti shift -color Red -bold 1;
  181. insert $ti shift -string "1."  -color Red -bold 1;
  182. insert $ti shift -color -1;
  183. insert $ti shift -string "    Window names:"  -bold 1;
  184. insert $ti shift -bold -1;
  185. insert $ti shift -string " " ;
  186. insert $ti shift -family Courier -color Green -bold 1;
  187. insert $ti shift -string ".a.b.c"  -family Courier -color Green -bold 1;
  188. insertPara $ti shift  -family -1 -color -1 -bold -1;
  189. tlconfig $ti cursor  -paraspace 2.50;
  190. insert $ti shift -color Red -bold 1;
  191. insert $ti shift -string "2."  -color Red -bold 1;
  192. insert $ti shift -color -1;
  193. insert $ti shift -string "    Caching (efficiency, convenience):"  -bold 1;
  194. insertPara $ti shift ;
  195. tlconfig $ti cursor -plook { -color Red} -look BSubheading;
  196. insert $ti shift -string "Window information (size, parent, etc.)." ;
  197. insertPara $ti shift ;
  198. tlconfig $ti cursor -plook { -color Red};
  199. insert $ti shift -string "X resources (colors, fonts, GCs, etc.)." ;
  200. insertPara $ti shift ;
  201. tlconfig $ti cursor  -look 1.Heading -paraspace 2.50;
  202. insert $ti shift -color Red;
  203. insert $ti shift -string "3."  -color Red;
  204. insert $ti shift -color -1;
  205. insert $ti shift -string "    " ;
  206. insert $ti shift -bold 1;
  207. insert $ti shift -string "Protocol intermediary"  -bold 1;
  208. insert $ti shift -bold -1;
  209. insert $ti shift -string ":" ;
  210. insertPara $ti shift ;
  211. tlconfig $ti cursor -plook { -color Red} -look BSubheading;
  212. insert $ti shift -string "Event dispatching." ;
  213. insertPara $ti shift ;
  214. tlconfig $ti cursor -plook { -color Red};
  215. insert $ti shift -string "Geometry management." ;
  216. insertPara $ti shift ;
  217. tlconfig $ti cursor -plook { -color Red};
  218. insert $ti shift -string "Selection protocols." ;
  219. insertPara $ti shift ;
  220. tlconfig $ti cursor -plook { -color Red};
  221. insert $ti shift -string "Keyboard focus." ;
  222. insertPara $ti shift ;
  223. tlconfig $ti cursor -plook { -color Red};
  224. insert $ti shift -string "Window manager." ;
  225. insertPara $ti shift ;
  226. tlconfig $ti cursor -plook { -color Red};
  227. insert $ti shift -string "Error handling." ;
  228. set ti;
  229.  
  230. view active 4slide
  231. backg - 2
  232. new - rectangle "153 661.5 270 688.5" -look Drawing -fg Black -bg Yellow -fp Solid -width 1.00 -feather White -dir 90
  233. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  234. tiformat $ti 0 0 0 1 -revert 1;
  235. insert $ti shift -revert 1;
  236. tlconfig $ti cursor  -look Title;
  237. insert $ti shift -revert 1;
  238. insert $ti shift -string "The Structure of a Widget" ;
  239. set ti;
  240. set ti [new - textitem "45 135 585 437.336" -look TextBox];
  241. tiformat $ti 0 0 0 1 -revert 1;
  242. insert $ti shift -revert 1;
  243. tlconfig $ti cursor  -look Heading;
  244. insert $ti shift -revert 1;
  245. insert $ti shift -string "Data structures for each widget:" ;
  246. insertPara $ti shift ;
  247. tlconfig $ti cursor -plook { -color Red} -look BSubheading;
  248. insert $ti shift -string "Tk_Window"  -family Courier -bold 1;
  249. insert $ti shift -family -1 -bold -1;
  250. insert $ti shift -string " managed by Tk." ;
  251. insertPara $ti shift ;
  252. tlconfig $ti cursor -plook { -color Red};
  253. insert $ti shift -string "Widget record managed by widget code." ;
  254. insertPara $ti shift ;
  255. tlconfig $ti cursor  -look Heading -paraspace 2.00;
  256. insert $ti shift -string "C code for widget class:" ;
  257. insertPara $ti shift ;
  258. tlconfig $ti cursor -plook { -color Red} -look BSubheading;
  259. insert $ti shift -string "Tcl " ;
  260. insert $ti shift -color Red;
  261. insert $ti shift -string "class command"  -color Red;
  262. insert $ti shift -color -1;
  263. insert $ti shift -string " to create widgets." ;
  264. insertPara $ti shift ;
  265. tlconfig $ti cursor -plook { -color Red};
  266. insert $ti shift -string "Tcl " ;
  267. insert $ti shift -color Red;
  268. insert $ti shift -string "widget command"  -color Red;
  269. insert $ti shift -color -1;
  270. insert $ti shift -string " to manipulate widgets." ;
  271. insertPara $ti shift ;
  272. tlconfig $ti cursor -plook { -color Red};
  273. insert $ti shift -string "Supporting C procedures (e.g. redisplay)." ;
  274. set ti;
  275. new - rectangle "72 522 162 639" -look Drawing -fg Black -bg Yellow -fp Solid -width 1.00 -feather White -dir 90
  276. set ti [new - textitem "49.5 495 184.5 520.87" -look TextBox];
  277. tiformat $ti 0 0 0 1 -revert 1;
  278. insert $ti shift -revert 1;
  279. tlconfig $ti cursor  -look Text -justify center;
  280. insert $ti shift -revert 1;
  281. insert $ti shift -family Courier -pointsize 22;
  282. insert $ti shift -string "Tk_Window"  -family Courier -pointsize 22;
  283. tiformat $ti 0 9 0 10 -family Courier -pointsize 22;
  284. set ti;
  285. new - arc "114.75 555.75 119.25 560.25 0 23040" -look Drawing -fg Black -bg Black -fp Solid -width 1.00
  286. set ti [new - textitem "157.5 688.691 265.5 715.309" -look TextBox];
  287. tiformat $ti 0 0 0 1 -revert 1;
  288. insert $ti shift -revert 1;
  289. tlconfig $ti cursor  -look Text -justify center;
  290. insert $ti shift -revert 1;
  291. insert $ti shift -pointsize 22;
  292. insert $ti shift -string "X Window"  -pointsize 22;
  293. tiformat $ti 0 8 0 9 -pointsize 22;
  294. set ti;
  295. new - arc "117 657 135 675 11520 5760" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  296. new - line "117 558 117 666" -look Drawing -fg Black -width 1.00 -arrow none
  297. new - line "126 675 153 675" -look Drawing -fg Black -width 1.00 -arrow head
  298. new - rectangle "225 522 297 612" -look Drawing -fg Black -bg Yellow -fp Solid -width 1.00 -feather White -dir 90
  299. new - arc "258.75 537.75 263.25 542.25 0 23040" -look Drawing -fg Black -bg Black -fp Solid -width 1.00
  300. new - line "261 540 162 540" -look Drawing -fg Black -width 1.00 -arrow head
  301. set ti [new - textitem "234 468 306 519.236" -look TextBox];
  302. tiformat $ti 0 0 0 1 -revert 1;
  303. insert $ti shift -revert 1;
  304. tlconfig $ti cursor  -look Text -linespace 0.00 -paraspace 0.00 -justify center;
  305. insert $ti shift -revert 1;
  306. insert $ti shift -pointsize 22;
  307. insert $ti shift -string "Widget"  -pointsize 22;
  308. insertPara $ti shift ;
  309. insert $ti shift -string "Record"  -pointsize 22;
  310. tiformat $ti 1 6 1 7 -pointsize 22;
  311. set ti;
  312. new - arc "369 549 387 567 0 23040" -look Drawing -fg Black -bg Green -fp Solid -width 1.00
  313. new - arc "369 576 387 594 0 23040" -look Drawing -fg Black -bg Green -fp Solid -width 1.00
  314. new - arc "369 603 387 621 0 23040" -look Drawing -fg Black -bg Green -fp Solid -width 1.00
  315. new - arc "360 630 378 648 0 23040" -look Drawing -fg Black -bg Green -fp Solid -width 1.00
  316. new - arc "333 639 351 657 0 23040" -look Drawing -fg Black -bg Green -fp Solid -width 1.00
  317. new - arc "360 540 396 576 0 11648" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  318. new - arc "324 630 360 666 5760 11712" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  319. new - arc "324 594 360 630 17280 5760" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  320. new - line "360 558 360 612" -look Drawing -fg Black -width 1.00 -arrow none
  321. new - arc "306 576 396 666 17280 5760" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  322. new - line "396 558 396 621" -look Drawing -fg Black -width 1.00 -arrow none
  323. new - line "342 666 351 666" -look Drawing -fg Black -width 1.00 -arrow none
  324. set ti [new - textitem "351 648 468 694.33" -look TextBox];
  325. tiformat $ti 0 0 0 1 -revert 1;
  326. insert $ti shift -revert 1;
  327. tlconfig $ti cursor  -look Text -linespace 0.00 -paraspace 0.00 -justify center;
  328. insert $ti shift -revert 1;
  329. insert $ti shift -color Green -pointsize 22;
  330. insert $ti shift -string "C Procedures"  -color Green -pointsize 22;
  331. tiformat $ti 0 12 0 13 -color Green -pointsize 22;
  332. set ti;
  333. new - arc "423 486 576 558 0 23040" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  334. set ti [new - textitem "427.5 459 571.5 485.618" -look TextBox];
  335. tiformat $ti 0 0 0 1 -revert 1;
  336. insert $ti shift -revert 1;
  337. tlconfig $ti cursor  -look Text -justify center;
  338. insert $ti shift -revert 1;
  339. insert $ti shift -color Red -pointsize 22;
  340. insert $ti shift -string "Tcl Commands"  -color Red -pointsize 22;
  341. tiformat $ti 0 12 0 13 -color Red -pointsize 22;
  342. set ti;
  343. new - rectangle "441 517.5 450 526.5" -look Drawing -fg Black -bg Red -fp Solid -width 1.00 -feather White -dir 90;
  344. new - rectangle "477 517.5 486 526.5" -look Drawing -fg Black -bg Red -fp Solid -width 1.00 -feather White -dir 90;
  345. new - rectangle "459 499.5 468 508.5" -look Drawing -fg Black -bg Red -fp Solid -width 1.00 -feather White -dir 90;
  346. new - rectangle "495 499.5 504 508.5" -look Drawing -fg Black -bg Red -fp Solid -width 1.00 -feather White -dir 90;
  347. new - rectangle "513 517.5 522 526.5" -look Drawing -fg Black -bg Red -fp Solid -width 1.00 -feather White -dir 90;
  348. new - rectangle "459 535.5 468 544.5" -look Drawing -fg Black -bg Red -fp Solid -width 1.00 -feather White -dir 90;
  349. new - rectangle "495 535.5 504 544.5" -look Drawing -fg Black -bg Red -fp Solid -width 1.00 -feather White -dir 90;
  350. new - rectangle "531 499.5 540 508.5" -look Drawing -fg Black -bg Red -fp Solid -width 1.00 -feather White -dir 90;
  351. new - rectangle "531 535.5 540 544.5" -look Drawing -fg Black -bg Red -fp Solid -width 1.00 -feather White -dir 90;
  352. new - rectangle "549 517.5 558 526.5" -look Drawing -fg Black -bg Red -fp Solid -width 1.00 -feather White -dir 90;
  353. group - 10
  354. new - arc "463.5 549 499.5 585 17280 5760" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  355. new - line "499.5 540 499.5 571.5" -look Drawing -fg Black -width 1.00 -arrow none
  356. new - line "481.5 585 387 585" -look Drawing -fg Black -width 1.00 -arrow head
  357. new - arc "378 504 414 540 5760 5760" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  358. new - line "378 522 378 549" -look Drawing -fg Black -width 1.00 -arrow head
  359. new - line "463.5 504 396 504" -look Drawing -fg Black -width 1.00 -arrow none
  360. new - arc "315 558 333 576 0 5760" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  361. new - arc "333 585 351 603 11520 5760" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  362. new - line "324 558 297 558" -look Drawing -fg Black -width 1.00 -arrow head
  363. new - line "333 594 333 567" -look Drawing -fg Black -width 1.00 -arrow none
  364. new - line "342 603 360 603" -look Drawing -fg Black -width 1.00 -arrow none
  365.  
  366. view active 5slide
  367. backg - 2
  368. set ti [new - title "45 63.5 585 109.456" -look TextBox];
  369. tiformat $ti 0 0 0 1 -revert 1;
  370. insert $ti shift -revert 1;
  371. tlconfig $ti cursor  -look Title;
  372. insert $ti shift -revert 1;
  373. insert $ti shift -string "Philosophy: Widgets Are Reactive" ;
  374. set ti;
  375. set ti [new - textitem "45 162 585 615.31616" -look TextBox];
  376. tiformat $ti 0 0 0 1 -revert 1;
  377. insert $ti shift -revert 1;
  378. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  379. insert $ti shift -revert 1;
  380. insert $ti shift -string "User is in control, not Tk or widget or application." ;
  381. insertPara $ti shift ;
  382. tlconfig $ti cursor -plook { -color Red} -paraspace 4.00;
  383. insert $ti shift -string "Widget code is " ;
  384. insert $ti shift -color Red;
  385. insert $ti shift -string "event-driven"  -color Red;
  386. insert $ti shift -color -1;
  387. insert $ti shift -string ": responds to events around it." ;
  388. insertPara $ti shift ;
  389. tlconfig $ti cursor -plook { -color Red};
  390. insert $ti shift -string "Procedures in widget are invoked when events occur, e.g.:" ;
  391. insertPara $ti shift ;
  392. tlconfig $ti cursor  -look Subheading;
  393. insert $ti shift -string "-  Tcl command invoked." ;
  394. insertPara $ti shift ;
  395. insert $ti shift -string "-  Window needs to be redrawn." ;
  396. insertPara $ti shift ;
  397. insert $ti shift -string "-  Window destroyed." ;
  398. insertPara $ti shift ;
  399. set ti;
  400.  
  401. view active 6slide
  402. backg - 2
  403. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  404. tiformat $ti 0 0 0 1 -revert 1;
  405. insert $ti shift -revert 1;
  406. tlconfig $ti cursor  -look Title;
  407. insert $ti shift -revert 1;
  408. insert $ti shift -string "Tk and Xlib" ;
  409. set ti;
  410. set ti [new - textitem "45 135 567 166.304" -look TextBox];
  411. tiformat $ti 0 0 0 1 -revert 1;
  412. insert $ti shift -revert 1;
  413. tlconfig $ti cursor  -look Heading;
  414. insert $ti shift -revert 1;
  415. insert $ti shift -string "When should widget call Tk, when Xlib?" ;
  416. set ti;
  417. set ti [new - textitem "45 432 585 690.4544" -look TextBox];
  418. tiformat $ti 0 0 0 1 -revert 1;
  419. insert $ti shift -revert 1;
  420. tlconfig $ti cursor  -look Heading;
  421. insert $ti shift -revert 1;
  422. insert $ti shift -string "Call Xlib only to draw on screen." ;
  423. insertPara $ti shift ;
  424. tlconfig $ti cursor  -paraspace 2.00;
  425. insert $ti shift -string "Call Tk for everything else:" ;
  426. insertPara $ti shift ;
  427. tlconfig $ti cursor -plook { -color Red} -look BSubheading;
  428. insert $ti shift -string "Creating windows." ;
  429. insertPara $ti shift ;
  430. tlconfig $ti cursor -plook { -color Red};
  431. insert $ti shift -string "Manipulating windows (map, resize, etc.)." ;
  432. insertPara $ti shift ;
  433. tlconfig $ti cursor -plook { -color Red};
  434. insert $ti shift -string "Managing events." ;
  435. insertPara $ti shift ;
  436. tlconfig $ti cursor -plook { -color Red};
  437. insert $ti shift -string "Allocating resources (colors, GCs, etc.)." ;
  438. set ti;
  439. new - rectangle "171 342 396 396" -look Drawing -fg Black -bg Yellow -fp Solid -width 1.00 -feather White -dir 90
  440. new - rectangle "171 252 324 324" -look Drawing -fg Black -bg Yellow -fp Solid -width 1.00 -feather White -dir 90
  441. new - rectangle "252 189 441 225" -look Drawing -fg Black -bg Yellow -fp Solid -width 1.00 -feather White -dir 90
  442. new - line "288 225 288 252" -look Drawing -fg Black -width 1.00 -arrow head
  443. new - line "360 225 360 342" -look Drawing -fg Black -width 1.00 -arrow head
  444. set ti [new - textitem "193.5 273.572 301.5 302.428" -look TextBox];
  445. tiformat $ti 0 0 0 1 -revert 1;
  446. insert $ti shift -revert 1;
  447. tlconfig $ti cursor  -look Text -justify center;
  448. insert $ti shift -revert 1;
  449. insert $ti shift -string "Tk" ;
  450. set ti;
  451. set ti [new - textitem "229.5 354.572 337.5 383.428" -look TextBox];
  452. tiformat $ti 0 0 0 1 -revert 1;
  453. insert $ti shift -revert 1;
  454. tlconfig $ti cursor  -look Text -justify center;
  455. insert $ti shift -revert 1;
  456. insert $ti shift -string "Xlib" ;
  457. set ti;
  458. set ti [new - textitem "279 192.572 414 221.428" -look TextBox];
  459. tiformat $ti 0 0 0 1 -revert 1;
  460. insert $ti shift -revert 1;
  461. tlconfig $ti cursor  -look Text -justify center;
  462. insert $ti shift -revert 1;
  463. insert $ti shift -string "Widget Code" ;
  464. set ti;
  465.  
  466. view active 7slide
  467. backg - 2
  468. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  469. tiformat $ti 0 0 0 1 -revert 1;
  470. insert $ti shift -revert 1;
  471. tlconfig $ti cursor  -look Title;
  472. insert $ti shift -revert 1;
  473. insert $ti shift -string "Example: Square Widget" ;
  474. set ti;
  475. set ti [new - textitem "45 171 585 555.37208" -look TextBox];
  476. tiformat $ti 0 0 0 1 -revert 1;
  477. insert $ti shift -revert 1;
  478. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  479. insert $ti shift -revert 1;
  480. insert $ti shift -string "Displays colored square on background." ;
  481. insertPara $ti shift ;
  482. tlconfig $ti cursor -plook { -color Red} -paraspace 4.00;
  483. insert $ti shift -string "Widget command allows square to be moved, resized:" ;
  484. insertPara $ti shift ;
  485. tlconfig $ti cursor  -look Code -paraspace 1.50;
  486. insert $ti shift -string ".s position 20 30" ;
  487. insertPara $ti shift ;
  488. tlconfig $ti cursor  -paraspace -1;
  489. insert $ti shift -string ".s size 10" ;
  490. insertPara $ti shift ;
  491. tlconfig $ti cursor -plook { -color Red} -look BHeading -paraspace 4.00;
  492. insert $ti shift -string "Can write fancier behaviors in Tcl:" ;
  493. insertPara $ti shift ;
  494. tlconfig $ti cursor  -look Subheading;
  495. insert $ti shift -string "-  Drag square with mouse." ;
  496. insertPara $ti shift ;
  497. tlconfig $ti cursor  -paraspace 1.20;
  498. insert $ti shift -string "-  Animate." ;
  499. set ti;
  500.  
  501. view active 8slide
  502. backg - 2
  503. set ti [new - title "45 63.5 594 109.456" -look TextBox];
  504. tiformat $ti 0 0 0 1 -revert 1;
  505. insert $ti shift -revert 1;
  506. tlconfig $ti cursor  -look Title;
  507. insert $ti shift -revert 1;
  508. insert $ti shift -string "Creating a Widget" ;
  509. set ti;
  510. set ti [new - textitem "45 135 594 677.52896" -look TextBox];
  511. tiformat $ti 0 0 0 1 -revert 1;
  512. insert $ti shift -revert 1;
  513. tlconfig $ti cursor  -look BHeading;
  514. insert $ti shift -revert 1;
  515. insert $ti shift -string "Procedure " ;
  516. insert $ti shift -family Courier -bold 1;
  517. insert $ti shift -string "Tk_SquareCmd"  -family Courier -bold 1;
  518. insert $ti shift -family -1 -bold -1;
  519. insert $ti shift -string "." ;
  520. insertPara $ti shift ;
  521. tlconfig $ti cursor  -linespace 1.20 -paraspace 1.75;
  522. insert $ti shift -string "Invoked with Tcl command named after class:" ;
  523. insertPara $ti shift ;
  524. tlconfig $ti cursor  -look Code -paraspace 1.50;
  525. insert $ti shift -string "square .s -fg RoyalBlue1" ;
  526. insertPara $ti shift ;
  527. tlconfig $ti cursor  -look BHeading -paraspace 1.75;
  528. insert $ti shift -string "Class command registered in main program:" ;
  529. insertPara $ti shift ;
  530. tlconfig $ti cursor  -look Code -paraspace 1.50;
  531. insert $ti shift -string "Tcl_CreateCommand(interp, \"square\"," ;
  532. insertPara $ti shift ;
  533. tlconfig $ti cursor  -paraspace -1;
  534. insert $ti shift -string "   Tk_SquareCmd, ...)\;" ;
  535. insertPara $ti shift ;
  536. tlconfig $ti cursor  -look BHeading -paraspace 1.75;
  537. insert $ti shift -string "Create " ;
  538. insert $ti shift -family Courier -bold 1;
  539. insert $ti shift -string "Tk_Window"  -family Courier -bold 1;
  540. insert $ti shift -family -1 -bold -1;
  541. insert $ti shift -string " object (variable " ;
  542. insert $ti shift -family Courier -bold 1;
  543. insert $ti shift -string "tkwin"  -family Courier -bold 1;
  544. insert $ti shift -family -1 -bold -1;
  545. insert $ti shift -string " holds handle)." ;
  546. insertPara $ti shift ;
  547. insert $ti shift -string "Initialize widget record (" ;
  548. insert $ti shift -family Courier -bold 1;
  549. insert $ti shift -string "squarePtr"  -family Courier -bold 1;
  550. insert $ti shift -family -1 -bold -1;
  551. insert $ti shift -string "), set up callbacks." ;
  552. insertPara $ti shift ;
  553. insert $ti shift -string "Register widget command." ;
  554. insertPara $ti shift ;
  555. insert $ti shift -string "Configure widget using command-line arguments." ;
  556. insertPara $ti shift ;
  557. insert $ti shift -string "Don't map window: geometry manager will do it." ;
  558. set ti;
  559.  
  560. view active 9slide
  561. backg - 2
  562. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  563. tiformat $ti 0 0 0 1 -revert 1;
  564. insert $ti shift -revert 1;
  565. tlconfig $ti cursor  -look Title;
  566. insert $ti shift -revert 1;
  567. insert $ti shift -string "Delayed Window Creation" ;
  568. set ti;
  569. set ti [new - textitem "45 153 585 615.58592" -look TextBox];
  570. tiformat $ti 0 0 0 1 -revert 1;
  571. insert $ti shift -revert 1;
  572. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  573. insert $ti shift -revert 1;
  574. insert $ti shift -string "X window isn't created immediately by " ;
  575. insert $ti shift -family Courier -bold 1;
  576. insert $ti shift -string "Tk_CreateWindowFromPath"  -family Courier -bold 1;
  577. insert $ti shift -family -1 -bold -1;
  578. insert $ti shift -string "." ;
  579. insertPara $ti shift ;
  580. tlconfig $ti cursor -plook { -color Red} -paraspace 3.00;
  581. insert $ti shift -string "Tk_WindowId(tkwin)"  -family Courier -bold 1;
  582. insert $ti shift -family -1 -bold -1;
  583. insert $ti shift -string " returns " ;
  584. insert $ti shift -family Courier -bold 1;
  585. insert $ti shift -string "None"  -family Courier -bold 1;
  586. insert $ti shift -family -1 -bold -1;
  587. insert $ti shift -string "." ;
  588. insertPara $ti shift ;
  589. tlconfig $ti cursor -plook { -color Red};
  590. insert $ti shift -string "Window creation occurs when window mapped by " ;
  591. insert $ti shift -family Courier -bold 1;
  592. insert $ti shift -string "Tk_MapWindow"  -family Courier -bold 1;
  593. insert $ti shift -family -1 -bold -1;
  594. insert $ti shift -string "." ;
  595. insertPara $ti shift ;
  596. tlconfig $ti cursor -plook { -color Red};
  597. insert $ti shift -string "Delay saves overhead (can reconfigure without involving X server)." ;
  598. insertPara $ti shift ;
  599. tlconfig $ti cursor -plook { -color Red};
  600. insert $ti shift -string "Can force creation of X window with " ;
  601. insert $ti shift -family Courier -bold 1;
  602. insert $ti shift -string "Tk_MakeWindowExist"  -family Courier -bold 1;
  603. insert $ti shift -family -1 -bold -1;
  604. insert $ti shift -string "." ;
  605. set ti;
  606.  
  607. view active 10slide
  608. backg - 2
  609. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  610. tiformat $ti 0 0 0 1 -revert 1;
  611. insert $ti shift -revert 1;
  612. tlconfig $ti cursor  -look Title;
  613. insert $ti shift -revert 1;
  614. insert $ti shift -string "Configure Procedure" ;
  615. set ti;
  616. set ti [new - textitem "45 153 594 661.1504" -look TextBox];
  617. tiformat $ti 0 0 0 1 -revert 1;
  618. insert $ti shift -revert 1;
  619. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  620. insert $ti shift -revert 1;
  621. insert $ti shift -string "Procedure " ;
  622. insert $ti shift -family Courier -bold 1;
  623. insert $ti shift -string "ConfigureSquare"  -family Courier -bold 1;
  624. insert $ti shift -family -1 -bold -1;
  625. insert $ti shift -string "." ;
  626. insertPara $ti shift ;
  627. tlconfig $ti cursor -plook { -color Red} -paraspace 2.50;
  628. insert $ti shift -string "Processes " ;
  629. insert $ti shift -family Courier -bold 1;
  630. insert $ti shift -string "argc"  -family Courier -bold 1;
  631. insert $ti shift -family -1 -bold -1;
  632. insert $ti shift -string "/" ;
  633. insert $ti shift -family Courier -bold 1;
  634. insert $ti shift -string "argv"  -family Courier -bold 1;
  635. insert $ti shift -family -1 -bold -1;
  636. insert $ti shift -string ", modifies widget record, schedules widget redisplay." ;
  637. insertPara $ti shift ;
  638. tlconfig $ti cursor -plook { -color Red};
  639. insert $ti shift -string "Called from both class command and widget command." ;
  640. insertPara $ti shift ;
  641. tlconfig $ti cursor -plook { -color Red};
  642. insert $ti shift -string "Almost all of work done by Tk library procedure " ;
  643. insert $ti shift -family Courier -bold 1;
  644. insert $ti shift -string "Tk_ConfigureWidget"  -family Courier -bold 1;
  645. insert $ti shift -family -1 -bold -1;
  646. insert $ti shift -string "." ;
  647. insertPara $ti shift ;
  648. tlconfig $ti cursor -plook { -color Red};
  649. insert $ti shift -string "Class provides table of configuration options:  " ;
  650. insert $ti shift -family Courier -bold 1;
  651. insert $ti shift -string "configSpecs"  -family Courier -bold 1;
  652. insert $ti shift -family -1 -bold -1;
  653. insert $ti shift -string "." ;
  654. insertPara $ti shift ;
  655. tlconfig $ti cursor -plook { -color Red};
  656. insert $ti shift -string "ConfigureSquare must also call " ;
  657. insert $ti shift -family Courier -bold 1;
  658. insert $ti shift -string "Tk_GeometryRequest"  -family Courier -bold 1;
  659. insert $ti shift -family -1 -bold -1;
  660. insert $ti shift -string " to set desired size." ;
  661. set ti;
  662.  
  663. view active 11slide
  664. backg - 2
  665. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  666. tiformat $ti 0 0 0 1 -revert 1;
  667. insert $ti shift -revert 1;
  668. tlconfig $ti cursor  -look Title;
  669. insert $ti shift -revert 1;
  670. insert $ti shift -string "Display Procedure" ;
  671. set ti;
  672. set ti [new - textitem "45 144 585 675.61184" -look TextBox];
  673. tiformat $ti 0 0 0 1 -revert 1;
  674. insert $ti shift -revert 1;
  675. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  676. insert $ti shift -revert 1;
  677. insert $ti shift -string "Procedure " ;
  678. insert $ti shift -family Courier -bold 1 -italic 0 -underline 0;
  679. insert $ti shift -string "DisplaySquare"  -family Courier -bold 1 -italic 0 -underline 0;
  680. insert $ti shift -family -1 -bold -1 -italic -1 -underline -1;
  681. insert $ti shift -string "." ;
  682. insertPara $ti shift ;
  683. tlconfig $ti cursor -plook { -color Red} -paraspace 2.50;
  684. insert $ti shift -string "Redisplay is delayed:" ;
  685. insertPara $ti shift ;
  686. tlconfig $ti cursor  -look Subheading -left 54.00 -indent -18.00 -tabs { 36 72 108 144 180 216 252 288 324 360 396};
  687. insert $ti shift -string "-    Don't redisplay immediately (could result in multiple redisplays)." ;
  688. insertPara $ti shift ;
  689. tlconfig $ti cursor ;
  690. insert $ti shift -string "-    Instead, record what must be redrawn (for simple widgets, all or nothing)." ;
  691. insertPara $ti shift ;
  692. tlconfig $ti cursor ;
  693. insert $ti shift -string "-    Do actual redisplay when all pending work is finished:  use " ;
  694. insert $ti shift -family Courier -bold 1;
  695. insert $ti shift -string "Tk_DoWhenIdle()"  -family Courier -bold 1;
  696. insert $ti shift -family -1 -bold -1;
  697. insert $ti shift -string "." ;
  698. insertPara $ti shift ;
  699. tlconfig $ti cursor -plook { -color Red} -look BHeading -paraspace 2.50;
  700. insert $ti shift -string "Tk provides support for 3-D effects:" ;
  701. insertPara $ti shift ;
  702. tlconfig $ti cursor  -look Subheading;
  703. insert $ti shift -string "-  " ;
  704. insert $ti shift -family Courier -bold 1;
  705. insert $ti shift -string "Tk_3DBorder"  -family Courier -bold 1;
  706. insert $ti shift -family -1 -bold -1;
  707. insert $ti shift -string " data type." ;
  708. insertPara $ti shift ;
  709. insert $ti shift -string "-  " ;
  710. insert $ti shift -family Courier -bold 1;
  711. insert $ti shift -string "Tk_Fill3DRectangle()"  -family Courier -bold 1;
  712. insert $ti shift -family -1 -bold -1;
  713. insert $ti shift -string ", etc." ;
  714. insertPara $ti shift ;
  715. tlconfig $ti cursor -plook { -color Red} -look BHeading -paraspace 2.50;
  716. insert $ti shift -string "Double-buffering with pixmap to avoid flashing." ;
  717. set ti;
  718.  
  719. view active 12slide
  720. backg - 2
  721. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  722. tiformat $ti 0 0 0 1 -revert 1;
  723. insert $ti shift -revert 1;
  724. tlconfig $ti cursor  -look Title;
  725. insert $ti shift -revert 1;
  726. insert $ti shift -string "Widget Command Procedure" ;
  727. set ti;
  728. set ti [new - textitem "45 153 585 631.30808" -look TextBox];
  729. tiformat $ti 0 0 0 1 -revert 1;
  730. insert $ti shift -revert 1;
  731. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  732. insert $ti shift -revert 1;
  733. insert $ti shift -string "Procedure " ;
  734. insert $ti shift -family Courier -bold 1;
  735. insert $ti shift -string "SquareWidgetCmd"  -family Courier -bold 1;
  736. insert $ti shift -family -1 -bold -1;
  737. insert $ti shift -string "." ;
  738. insertPara $ti shift ;
  739. tlconfig $ti cursor -plook { -color Red} -paraspace 3.00;
  740. insert $ti shift -string "Decodes " ;
  741. insert $ti shift -family Courier -bold 1;
  742. insert $ti shift -string "argv\[1\]"  -family Courier -bold 1;
  743. insert $ti shift -family -1 -bold -1;
  744. insert $ti shift -string ", executes one of several commands." ;
  745. insertPara $ti shift ;
  746. tlconfig $ti cursor -plook { -color Red};
  747. insert $ti shift -string "Potentially modifies widget record." ;
  748. insertPara $ti shift ;
  749. tlconfig $ti cursor -plook { -color Red};
  750. insert $ti shift -string "Arranges for redisplay if necessary." ;
  751. insertPara $ti shift ;
  752. tlconfig $ti cursor  -look Heading;
  753. insertPara $ti shift ;
  754. tlconfig $ti cursor  -paraspace 4.00;
  755. insert $ti shift -color Red;
  756. insert $ti shift -string "Only provides primitive operations\;  complex features are implemented with Tcl scripts."  -color Red;
  757. set ti;
  758.  
  759. view active 13slide
  760. backg - 2
  761. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  762. tiformat $ti 0 0 0 1 -revert 1;
  763. insert $ti shift -revert 1;
  764. tlconfig $ti cursor  -look Title;
  765. insert $ti shift -revert 1;
  766. insert $ti shift -string "Event-Handling Procedure" ;
  767. set ti;
  768. set ti [new - textitem "45 171 585 592.55264" -look TextBox];
  769. tiformat $ti 0 0 0 1 -revert 1;
  770. insert $ti shift -revert 1;
  771. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  772. insert $ti shift -revert 1;
  773. insert $ti shift -string "Procedure " ;
  774. insert $ti shift -family Courier;
  775. insert $ti shift -string "SquareEventProc"  -family Courier;
  776. insert $ti shift -family -1;
  777. insert $ti shift -string "." ;
  778. insertPara $ti shift ;
  779. tlconfig $ti cursor -plook { -color Red} -paraspace 4.00;
  780. insert $ti shift -string "Most events (e.g. " ;
  781. insert $ti shift -family Courier;
  782. insert $ti shift -string "ButtonPress"  -family Courier;
  783. insert $ti shift -family -1;
  784. insert $ti shift -string ") handled with Tcl bindings (more flexible)." ;
  785. insertPara $ti shift ;
  786. tlconfig $ti cursor -plook { -color Red};
  787. insert $ti shift -string "Most widgets need C code only for " ;
  788. insert $ti shift -family Courier;
  789. insert $ti shift -string "Expose"  -family Courier;
  790. insert $ti shift -family -1;
  791. insert $ti shift -string ", " ;
  792. insert $ti shift -family Courier;
  793. insert $ti shift -string "DestroyNotify"  -family Courier;
  794. insert $ti shift -family -1;
  795. insert $ti shift -string ", maybe " ;
  796. insert $ti shift -family Courier;
  797. insert $ti shift -string "ConfigureNotify"  -family Courier;
  798. insert $ti shift -family -1;
  799. insert $ti shift -string "." ;
  800. insertPara $ti shift ;
  801. tlconfig $ti cursor -plook { -color Red};
  802. insert $ti shift -string "Handler set up during widget creation by calling " ;
  803. insert $ti shift -family Courier;
  804. insert $ti shift -string "Tk_CreateEventHandler"  -family Courier;
  805. insert $ti shift -family -1;
  806. insert $ti shift -string "." ;
  807. set ti;
  808.  
  809. view active 14slide
  810. backg - 2
  811. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  812. tiformat $ti 0 0 0 1 -revert 1;
  813. insert $ti shift -revert 1;
  814. tlconfig $ti cursor  -look Title;
  815. insert $ti shift -revert 1;
  816. insert $ti shift -string "Destroy Procedure" ;
  817. set ti;
  818. set ti [new - textitem "45 144 585 259.68608" -look TextBox];
  819. tiformat $ti 0 0 0 1 -revert 1;
  820. insert $ti shift -revert 1;
  821. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  822. insert $ti shift -revert 1;
  823. insert $ti shift -string "Procedure " ;
  824. insert $ti shift -family Courier -bold 1;
  825. insert $ti shift -string "DestroySquare"  -family Courier -bold 1;
  826. insert $ti shift -family -1 -bold -1;
  827. insert $ti shift -string "." ;
  828. insertPara $ti shift ;
  829. tlconfig $ti cursor -plook { -color Red} -paraspace 2.00;
  830. insert $ti shift -string "WARNING!"  -color Red;
  831. insert $ti shift -color -1;
  832. insert $ti shift -string "  Can't always clean up immediately:  widget record may be in use by nested procedure." ;
  833. set ti;
  834. set ti [new - textitem "81 288 333 316.51" -look TextBox];
  835. tiformat $ti 0 0 0 1 -revert 1;
  836. insert $ti shift -revert 1;
  837. tlconfig $ti cursor  -look Text -justify center;
  838. insert $ti shift -revert 1;
  839. insert $ti shift -family Courier -pointsize 22 -bold 1;
  840. insert $ti shift -string "<ButtonRelease-1"  -family Courier -pointsize 22 -bold 1;
  841. insert $ti shift -bold -1;
  842. insert $ti shift -string ">"  -family Courier -pointsize 22;
  843. tiformat $ti 0 17 0 18 -family Courier -pointsize 22;
  844. set ti;
  845. set ti [new - textitem "108 342 306 370.51" -look TextBox];
  846. tiformat $ti 0 0 0 1 -revert 1;
  847. insert $ti shift -revert 1;
  848. tlconfig $ti cursor  -look Text -justify center;
  849. insert $ti shift -revert 1;
  850. insert $ti shift -family Courier -color Green -pointsize 22 -bold 1;
  851. insert $ti shift -string ".button invoke"  -family Courier -color Green -pointsize 22 -bold 1;
  852. tiformat $ti 0 14 0 15 -family Courier -color Green -pointsize 22 -bold 1;
  853. set ti;
  854. set ti [new - textitem "72 396 342 424.51" -look TextBox];
  855. tiformat $ti 0 0 0 1 -revert 1;
  856. insert $ti shift -revert 1;
  857. tlconfig $ti cursor  -look Text -justify center;
  858. insert $ti shift -revert 1;
  859. insert $ti shift -family Courier -color Green -pointsize 22 -bold 1;
  860. insert $ti shift -string "ButtonWidgetCmd(...)"  -family Courier -color Green -pointsize 22 -bold 1;
  861. tiformat $ti 0 20 0 21 -family Courier -pointsize 22;
  862. set ti;
  863. set ti [new - textitem "126 450 288 478.51" -look TextBox];
  864. tiformat $ti 0 0 0 1 -revert 1;
  865. insert $ti shift -revert 1;
  866. tlconfig $ti cursor  -look Text -justify center;
  867. insert $ti shift -revert 1;
  868. insert $ti shift -family Courier -color Green -pointsize 22 -bold 1;
  869. insert $ti shift -string "destroy ."  -family Courier -color Green -pointsize 22 -bold 1;
  870. tiformat $ti 0 9 0 10 -family Courier -pointsize 22;
  871. set ti;
  872. set ti [new - textitem "72 504 342 532.51" -look TextBox];
  873. tiformat $ti 0 0 0 1 -revert 1;
  874. insert $ti shift -revert 1;
  875. tlconfig $ti cursor  -look Text -justify center;
  876. insert $ti shift -revert 1;
  877. insert $ti shift -family Courier -color Green -pointsize 22 -bold 1;
  878. insert $ti shift -string "ButtonEventProc(...)"  -family Courier -color Green -pointsize 22 -bold 1;
  879. tiformat $ti 0 20 0 21 -family Courier -pointsize 22;
  880. set ti;
  881. set ti [new - textitem "54 558 360 586.51" -look TextBox];
  882. tiformat $ti 0 0 0 1 -revert 1;
  883. insert $ti shift -revert 1;
  884. tlconfig $ti cursor  -look Text;
  885. insert $ti shift -revert 1;
  886. insert $ti shift -family Courier -color Red -pointsize 22;
  887. insert $ti shift -string "? "  -family Courier -color Red -pointsize 22;
  888. insert $ti shift -bold 1;
  889. insert $ti shift -string "DestroyButton(...)"  -family Courier -color Red -pointsize 22 -bold 1;
  890. insert $ti shift -bold -1;
  891. insert $ti shift -string " ?"  -family Courier -color Red -pointsize 22;
  892. tiformat $ti 0 22 0 23 -family Courier -color Red -pointsize 22;
  893. set ti;
  894. new - line "207 315 207 342" -look Drawing -fg Black -width 1.00 -arrow head
  895. new - line "207 369 207 396" -look Drawing -fg Black -width 1.00 -arrow head
  896. new - line "207 423 207 450" -look Drawing -fg Black -width 1.00 -arrow head
  897. new - line "207 477 207 504" -look Drawing -fg Black -width 1.00 -arrow head
  898. new - line "207 531 207 558" -look Drawing -fg Black -width 1.00 -arrow head
  899. new - rectangle "450 396 567 531" -look Drawing -fg Black -bg Yellow -fp Solid -width 1.00 -feather White -dir 90
  900. set ti [new - textitem "432 342 585 392.2724" -look TextBox];
  901. tiformat $ti 0 0 0 1 -revert 1;
  902. insert $ti shift -revert 1;
  903. tlconfig $ti cursor  -look Text -justify center;
  904. insert $ti shift -revert 1;
  905. insert $ti shift -pointsize 22;
  906. insert $ti shift -string "Button Widget Record"  -pointsize 22;
  907. tiformat $ti 0 20 0 21 -pointsize 22;
  908. set ti;
  909. new - line "342 408.935 441 408.935" -look Drawing -fg Black -width 1.00 -arrow head
  910. new - line "342 516.935 360 516.935" -look Drawing -fg Black -width 1.00 -arrow none
  911. new - arc "378 426.935 414 462.935 5760 5760" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  912. new - arc "342 480.935 378 516.935 17280 5760" -look Drawing -fg Black -bg None -fp Solid -width 1.00
  913. new - line "396 426.935 441 426.935" -look Drawing -fg Black -width 1.00 -arrow head
  914. new - line "378 444.935 378 498.935" -look Drawing -fg Black -width 1.00 -arrow none
  915. new - line "342 570.935 387 570.935" -look Drawing -fg Black -width 1.00 -arrow none
  916. new - arc "405 444.935 441 480.935 5760 5760" -look Drawing -fg Black -bg None -fp Solid -width 1.00;
  917. new - arc "369 534.935 405 570.935 17280 5760" -look Drawing -fg Black -bg None -fp Solid -width 1.00;
  918. new - line "423 444.935 441 444.935" -look Drawing -fg Black -width 1.00 -arrow head;
  919. new - line "405 462.935 405 552.935" -look Drawing -fg Black -width 1.00 -arrow none;
  920. group - 4
  921. set ti [new - textitem "45 621 585 654.272" -look TextBox];
  922. tiformat $ti 0 0 0 1 -revert 1;
  923. insert $ti shift -revert 1;
  924. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  925. insert $ti shift -revert 1;
  926. insert $ti shift -string "Solution: must delay destruction." ;
  927. set ti;
  928.  
  929. view active 15slide
  930. backg - 2
  931. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  932. tiformat $ti 0 0 0 1 -revert 1;
  933. insert $ti shift -revert 1;
  934. tlconfig $ti cursor  -look Title;
  935. insert $ti shift -revert 1;
  936. insert $ti shift -string "Delayed Window Destruction" ;
  937. set ti;
  938. set ti [new - textitem "45 135 585 713.5624" -look TextBox];
  939. tiformat $ti 0 0 0 1 -revert 1;
  940. insert $ti shift -revert 1;
  941. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  942. insert $ti shift -revert 1;
  943. insert $ti shift -string "Tk implements short-term reference counts." ;
  944. insertPara $ti shift ;
  945. tlconfig $ti cursor  -look Subheading -paraspace 1.00;
  946. insert $ti shift -string "E.g. in " ;
  947. insert $ti shift -family Courier -bold 1;
  948. insert $ti shift -string "ButtonWidgetCmd"  -family Courier -bold 1;
  949. insert $ti shift -family -1 -bold -1;
  950. insert $ti shift -string ":" ;
  951. insertPara $ti shift ;
  952. tlconfig $ti cursor  -look Code -paraspace 1.00;
  953. insert $ti shift -pointsize 22;
  954. insert $ti shift -string "Tk_Preserve((ClientData) butPtr)\;"  -pointsize 22;
  955. insertPara $ti shift ;
  956. tlconfig $ti cursor  -paraspace 0.00;
  957. insert $ti shift -string "..."  -pointsize 22;
  958. insertPara $ti shift ;
  959. insert $ti shift -string "Tcl_Eval(interp, butPtr->cmd, ...)\;"  -pointsize 22;
  960. insertPara $ti shift ;
  961. insert $ti shift -string "..."  -pointsize 22;
  962. insertPara $ti shift ;
  963. insert $ti shift -string "Tk_Release((ClientData) butPtr)\;"  -pointsize 22;
  964. insertPara $ti shift ;
  965. insert $ti shift -string "return result\;"  -pointsize 22;
  966. insertPara $ti shift ;
  967. tlconfig $ti cursor -plook { -color Red} -look BHeading -paraspace 1.75;
  968. insert $ti shift -string "Don't call destruction procedure directly:" ;
  969. insertPara $ti shift ;
  970. tlconfig $ti cursor  -look Subheading -paraspace 1.00;
  971. insert $ti shift -string "E.g. in " ;
  972. insert $ti shift -family Courier -bold 1;
  973. insert $ti shift -string "ButtonEventProc"  -family Courier -bold 1;
  974. insert $ti shift -family -1 -bold -1;
  975. insert $ti shift -string ":" ;
  976. insertPara $ti shift ;
  977. tlconfig $ti cursor  -look Code -paraspace 1.00;
  978. insert $ti shift -pointsize 22;
  979. insert $ti shift -string "if (eventPtr->type == DestroyNotify) \{"  -pointsize 22;
  980. insertPara $ti shift ;
  981. tlconfig $ti cursor  -paraspace 0.00;
  982. insert $ti shift -string "   ..."  -pointsize 22;
  983. insertPara $ti shift ;
  984. insert $ti shift -string "   Tk_EventuallyFree((ClientData)           butPtr, DestroyButton)\;"  -pointsize 22;
  985. insertPara $ti shift ;
  986. insert $ti shift -string "\}"  -pointsize 22;
  987. insertPara $ti shift ;
  988. tlconfig $ti cursor -plook { -color Red} -look BHeading -paraspace 1.75;
  989. insert $ti shift -string "DestroyButton(butPtr)"  -family Courier -bold 1;
  990. insert $ti shift -family -1 -bold -1;
  991. insert $ti shift -string " is invoked:" ;
  992. insertPara $ti shift ;
  993. tlconfig $ti cursor  -look Subheading;
  994. insert $ti shift -string "-  Immediately if (no " ;
  995. insert $ti shift -family Courier -bold 1;
  996. insert $ti shift -string "Tk_Preserve"  -family Courier -bold 1;
  997. insert $ti shift -family -1 -bold -1;
  998. insert $ti shift -string "'s pending)." ;
  999. insertPara $ti shift ;
  1000. insert $ti shift -string "-  During last " ;
  1001. insert $ti shift -family Courier -bold 1;
  1002. insert $ti shift -string "Tk_Release"  -family Courier -bold 1;
  1003. insert $ti shift -family -1 -bold -1;
  1004. insert $ti shift -string " call." ;
  1005. set ti;
  1006.  
  1007. view active 16slide
  1008. backg - 2
  1009. set ti [new - title "45 63.5 567 109.456" -look TextBox];
  1010. tiformat $ti 0 0 0 1 -revert 1;
  1011. insert $ti shift -revert 1;
  1012. tlconfig $ti cursor  -look Title;
  1013. insert $ti shift -revert 1;
  1014. insert $ti shift -string "Things To Remember" ;
  1015. set ti;
  1016. set ti [new - textitem "45 153 585 615.3248" -look TextBox];
  1017. tiformat $ti 0 0 0 1 -revert 1;
  1018. insert $ti shift -revert 1;
  1019. tlconfig $ti cursor -plook { -color Red} -look BHeading;
  1020. insert $ti shift -revert 1;
  1021. insert $ti shift -string "Event-driven style of programming." ;
  1022. insertPara $ti shift ;
  1023. tlconfig $ti cursor -plook { -color Red} -paraspace 2.50;
  1024. insert $ti shift -string "Delayed operations:" ;
  1025. insertPara $ti shift ;
  1026. tlconfig $ti cursor  -look Subheading;
  1027. insert $ti shift -string "-  Creation of X window." ;
  1028. insertPara $ti shift ;
  1029. insert $ti shift -string "-  Redisplay." ;
  1030. insertPara $ti shift ;
  1031. insert $ti shift -string "-  Destruction of widget record." ;
  1032. insertPara $ti shift ;
  1033. tlconfig $ti cursor -plook { -color Red} -look BHeading -paraspace 2.50;
  1034. insert $ti shift -string "Work within Tcl framework: focus on primitives." ;
  1035. insertPara $ti shift ;
  1036. tlconfig $ti cursor -plook { -color Red};
  1037. insert $ti shift -string "Use Tk caches, configuration support." ;
  1038. insertPara $ti shift ;
  1039. tlconfig $ti cursor  -look Heading -paraspace 4.00;
  1040. insert $ti shift -color Red;
  1041. insert $ti shift -string "Don't build from scratch: modify an existing widget."  -color Red;
  1042. tiformat $ti 7 52 7 53 -color Red;
  1043. set ti;
  1044.  
  1045. MakeWindow slide 13 0 .views.1 683x828+-1+5
  1046. SpotConfig .views.1 0 0 1 on
  1047. UpdateTitles; set generateName 2
  1048.