home *** CD-ROM | disk | FTP | other *** search
Unknown | 1993-06-20 | 21.5 KB |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was not able to be converted.
This format is not currently supported by dexvert.
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Wanton Packer Module (music/wantonPacker)
| ext
| Supported |
100%
| file
| data
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 00 00 00 00 00 00 01 | 04 00 54 df 04 00 55 d1 |........|..T...U.|
|00000010| 04 00 51 99 04 00 51 9b | 04 00 02 0c 00 1e 20 90 |..Q...Q.|...... .|
|00000020| 00 1e 20 78 00 05 47 5c | 00 1e 21 90 00 1e 20 8c |.. x..G\|..!... .|
|00000030| 00 00 00 00 00 00 00 00 | 00 04 00 00 00 00 00 00 |........|........|
|00000040| 09 00 00 00 00 00 00 00 | ff 00 00 00 00 00 ff 66 |........|.......f|
|00000050| 00 00 01 ae 02 64 00 00 | 00 9a 00 2b 30 0e 00 c6 |.....d..|...+0...|
|00000060| 31 29 01 b0 00 39 00 00 | 00 00 ff 00 00 00 00 00 |1)...9..|........|
|00000070| 00 00 00 00 00 00 01 01 | 02 64 00 00 00 48 00 48 |........|.d...H.H|
|00000080| 00 01 00 18 03 18 02 64 | 00 00 00 00 02 da 02 2f |.......d|......./|
|00000090| 00 64 00 04 19 00 04 00 | 52 12 00 1d ff b7 00 48 |.d......|R......H|
|000000a0| 00 2a 04 00 52 12 00 1d | ff b7 00 48 00 2a fc 71 |.*..R...|...H.*.q|
|000000b0| 00 00 04 3b 00 00 00 00 | ff ff 00 00 00 00 00 00 |...;....|........|
|000000c0| 55 eb 00 00 55 eb 00 00 | 55 eb 00 00 cb 8e 00 00 |U...U...|U.......|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 00 00 00 04 00 50 8d | 04 00 51 7f 04 00 51 99 |......P.|..Q...Q.|
|00000110| 04 00 51 9b 04 00 02 0c | 00 05 47 f0 00 05 48 44 |..Q.....|..G...HD|
|00000120| 00 05 48 1c 00 05 48 fc | 00 05 48 34 00 00 00 00 |..H...H.|..H4....|
|00000130| 00 00 00 00 00 04 00 00 | 00 00 00 00 09 00 00 00 |........|........|
|00000140| 00 00 00 00 ff 00 ff 00 | 01 00 ff 66 00 00 01 ae |........|...f....|
|00000150| 02 64 00 00 00 9a 00 2b | 30 0e 00 c6 31 29 01 b0 |.d.....+|0...1)..|
|00000160| 00 39 00 00 00 00 ff 00 | 00 00 00 00 00 00 00 00 |.9......|........|
|00000170| 00 00 01 01 02 64 00 00 | 00 48 00 48 00 01 00 18 |.....d..|.H.H....|
|00000180| 03 18 02 64 00 00 00 00 | 02 da 02 2f 00 64 00 04 |...d....|.../.d..|
|00000190| 19 00 04 00 1c 1b 00 1e | ff b7 00 48 00 2a 04 00 |........|...H.*..|
|000001a0| 1c 1b 00 1e ff b7 00 48 | 00 2a fc 71 00 00 00 00 |.......H|.*.q....|
|000001b0| 00 00 00 00 00 ff 00 00 | 00 00 00 00 51 a3 00 00 |........|....Q...|
|000001c0| 51 a3 00 00 51 a3 00 00 | cb 8e 00 00 00 00 00 00 |Q...Q...|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 00 04 0d 0d 0d 0d 00 04 | 0d 0d 0d 0d 00 78 00 03 |........|.....x..|
|00000210| 00 00 00 48 00 48 00 00 | 00 00 02 da 02 2f 00 00 |...H.H..|...../..|
|00000220| 00 00 03 18 02 64 01 5b | 05 28 03 fc 00 02 00 00 |.....d.[|.(......|
|00000230| 00 48 00 48 00 00 00 00 | 03 18 02 64 00 01 00 00 |.H.H....|...d....|
|00000240| 00 64 00 00 00 01 00 01 | 01 01 00 00 00 01 27 0f |.d......|......'.|
|00000250| 00 01 00 01 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 02 00 19 01 90 00 00 | 00 00 00 40 00 00 00 00 |........|...@....|
|00000270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000280| 00 00 00 00 00 00 00 5f | 0d ff 00 15 0a 00 f7 4f |......._|.......O|
|00000290| 62 6a 65 63 74 20 42 61 | 73 65 64 20 43 6f 6d 70 |bject Ba|sed Comp|
|000002a0| 75 74 69 6e 67 3a 20 41 | 20 4e 65 58 54 73 74 65 |uting: A| NeXTste|
|000002b0| 70 20 54 75 74 6f 72 69 | 61 6c 20 61 6e 64 20 43 |p Tutori|al and C|
|000002c0| 6f 6f 6b 62 6f 6f 6b 20 | 2d 20 44 47 4d 0d 43 68 |ookbook |- DGM.Ch|
|000002d0| 61 70 74 65 72 20 39 3a | 20 4d 6f 72 65 20 44 72 |apter 9:| More Dr|
|000002e0| 61 77 69 6e 67 0d 0d 01 | 55 0d fc 00 90 02 0a 00 |awing...|U.......|
|000002f0| 90 00 0e 02 d0 06 30 f7 | ff 00 16 0a 00 f7 2b 6e |......0.|......+n|
|00000300| 65 77 46 72 61 6d 65 3a | 28 63 6f 6e 73 74 20 4e |ewFrame:|(const N|
|00000310| 58 52 65 63 74 20 2a 29 | 74 46 20 7b 0d 20 20 20 |XRect *)|tF {. |
|00000320| 20 73 65 6c 66 20 3d 20 | 5b 73 75 70 65 72 20 6e | self = |[super n|
|00000330| 65 77 46 72 61 6d 65 3a | 74 46 5d 3b 0d 20 20 20 |ewFrame:|tF];. |
|00000340| 20 6f 72 69 67 69 6e 58 | 20 3d 20 35 30 2e 30 3b | originX| = 50.0;|
|00000350| 0d 20 20 20 20 6f 72 69 | 67 69 6e 59 20 3d 20 31 |. ori|ginY = 1|
|00000360| 30 30 2e 30 3b 0d 20 20 | 20 20 73 63 61 6c 65 58 |00.0;. | scaleX|
|00000370| 20 3d 20 31 2e 30 3b 0d | 20 20 20 20 73 63 61 6c | = 1.0;.| scal|
|00000380| 65 59 20 3d 20 31 2e 30 | 3b 0d 20 20 20 20 62 61 |eY = 1.0|;. ba|
|00000390| 63 6b 67 72 6f 75 6e 64 | 47 72 61 79 20 3d 20 31 |ckground|Gray = 1|
|000003a0| 2e 30 3b 0d 20 20 20 20 | 6c 69 6e 65 47 72 61 79 |.0;. |lineGray|
|000003b0| 20 3d 20 30 2e 30 3b 0d | 20 20 20 20 6c 69 6e 65 | = 0.0;.| line|
|000003c0| 57 69 64 74 68 20 3d 20 | 31 30 2e 30 3b 0d 20 20 |Width = |10.0;. |
|000003d0| 20 20 72 6f 74 61 74 69 | 6f 6e 20 3d 20 30 2e 30 | rotati|on = 0.0|
|000003e0| 3b 0d 20 20 20 20 64 65 | 73 74 69 6e 61 74 69 6f |;. de|stinatio|
|000003f0| 6e 58 20 3d 20 34 30 30 | 2e 30 3b 0d 20 20 20 20 |nX = 400|.0;. |
|00000400| 64 65 73 74 69 6e 61 74 | 69 6f 6e 59 20 3d 20 35 |destinat|ionY = 5|
|00000410| 30 30 2e 30 3b 0d 20 20 | 20 20 72 65 74 75 72 6e |00.0;. | return|
|00000420| 20 73 65 6c 66 3b 0d 7d | ff 00 15 0a 00 f7 0d fc | self;.}|........|
|00000430| 00 6c 02 0a 00 6c 00 0e | 02 d0 06 30 f7 0d 00 01 |.l...l..|...0....|
|00000440| 0d 00 22 fb 00 00 00 01 | 01 43 00 d1 39 2d 31 5f |..".....|.C..9-1_|
|00000450| 50 72 6f 6a 5f 70 73 77 | 2e 33 34 34 39 31 32 2e |Proj_psw|.344912.|
|00000460| 65 70 73 f7 0d 02 06 63 | 63 20 2d 4f 20 2d 67 20 |eps....c|c -O -g |
|00000470| 2d 57 69 6d 70 6c 69 63 | 69 74 20 2d 63 20 63 69 |-Wimplic|it -c ci|
|00000480| 72 63 6c 65 2e 63 20 2d | 6f 20 6f 62 6a 2f 63 69 |rcle.c -|o obj/ci|
|00000490| 72 63 6c 65 2e 6f 0d 0d | fc 00 6c 02 0a 00 6c 00 |rcle.o..|..l...l.|
|000004a0| 0e 02 44 06 30 f7 ff 00 | 15 0a 00 f7 54 68 65 20 |..D.0...|....The |
|000004b0| 66 69 72 73 74 20 6c 69 | 6e 65 20 77 69 6c 6c 20 |first li|ne will |
|000004c0| 63 72 65 61 74 65 20 43 | 20 70 72 6f 67 72 61 6d |create C| program|
|000004d0| 20 61 6e 64 20 68 65 61 | 64 65 72 20 66 69 6c 65 | and hea|der file|
|000004e0| 20 66 72 6f 6d 20 74 68 | 65 20 6f 75 72 20 50 6f | from th|e our Po|
|000004f0| 73 74 53 63 72 69 70 74 | 20 73 6f 75 72 63 65 2e |stScript| source.|
|00000500| 20 20 54 68 69 73 20 69 | 73 20 73 69 6d 69 6c 61 | This i|s simila|
|00000510| 72 20 74 6f 20 61 20 70 | 72 65 2d 63 6f 6d 70 69 |r to a p|re-compi|
|00000520| 6c 65 64 20 76 65 72 73 | 69 6f 6e 20 6f 66 20 50 |led vers|ion of P|
|00000530| 6f 73 74 53 63 72 69 70 | 74 2e 20 20 54 68 65 20 |ostScrip|t. The |
|00000540| 73 65 63 6f 6e 64 20 6c | 69 6e 65 20 77 69 6c 6c |second l|ine will|
|00000550| 20 63 6f 6d 70 69 6c 65 | 20 74 68 61 74 20 43 20 | compile| that C |
|00000560| 70 72 6f 67 72 61 6d 20 | 61 6e 64 20 70 75 74 20 |program |and put |
|00000570| 74 68 65 20 62 69 6e 61 | 72 79 20 69 6e 20 61 20 |the bina|ry in a |
|00000580| 64 69 72 65 63 74 6f 72 | 79 20 77 68 65 72 65 20 |director|y where |
|00000590| 69 74 20 77 69 6c 6c 20 | 62 65 20 6c 69 6e 6b 65 |it will |be linke|
|000005a0| 64 20 69 6e 74 6f 20 74 | 68 65 20 6d 61 69 6e 20 |d into t|he main |
|000005b0| 70 72 6f 67 72 61 6d 2e | 0d 0d 54 68 65 20 65 6e |program.|..The en|
|000005c0| 64 20 72 65 73 75 6c 74 | 20 6f 66 20 74 68 65 20 |d result| of the |
|000005d0| 65 78 61 6d 70 6c 65 20 | 70 72 6f 67 72 61 6d 20 |example |program |
|000005e0| 69 73 20 74 68 61 74 20 | 77 65 20 63 61 6e 20 6e |is that |we can n|
|000005f0| 6f 77 20 64 72 61 77 20 | 61 20 63 69 72 63 6c 65 |ow draw |a circle|
|00000600| 20 61 74 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | at the |current |
|00000610| 70 6f 69 6e 74 20 77 69 | 74 68 20 61 6e 79 20 72 |point wi|th any r|
|00000620| 61 64 69 75 73 20 61 6e | 64 20 73 68 61 64 65 20 |adius an|d shade |
|00000630| 77 69 74 68 20 61 20 73 | 69 6e 67 6c 65 20 63 6f |with a s|ingle co|
|00000640| 6d 6d 61 6e 64 2e 20 20 | 54 68 65 20 66 6f 6c 6c |mmand. |The foll|
|00000650| 6f 77 69 6e 67 20 69 73 | 20 61 6e 20 65 78 61 6d |owing is| an exam|
|00000660| 70 6c 65 20 6f 66 20 74 | 68 69 73 3a 0d 01 70 0d |ple of t|his:..p.|
|00000670| fc 00 8f 02 1c 00 8f 00 | 0d 02 90 02 e8 03 48 03 |........|......H.|
|00000680| a8 04 08 04 68 04 c8 05 | 28 05 88 05 e8 06 48 06 |....h...|(.....H.|
|00000690| a8 07 08 07 68 07 c8 08 | 28 f7 ff 00 16 0a 01 f7 |....h...|(.......|
|000006a0| 64 65 66 69 6e 65 70 73 | 20 64 72 61 77 43 69 72 |defineps| drawCir|
|000006b0| 63 6c 65 28 66 6c 6f 61 | 74 20 72 61 64 69 75 73 |cle(floa|t radius|
|000006c0| 2c 20 73 68 61 64 65 29 | 20 0d ff 00 16 0a 00 f7 |, shade)| .......|
|000006d0| 67 73 61 76 65 20 0d 20 | 20 09 63 75 72 72 65 6e |gsave . | .curren|
|000006e0| 74 70 6f 69 6e 74 0d 09 | 6e 65 77 70 61 74 68 0d |tpoint..|newpath.|
|000006f0| 09 09 72 61 64 69 75 73 | 20 30 20 33 36 30 20 61 |..radius| 0 360 a|
|00000700| 72 63 0d 09 73 68 61 64 | 65 20 73 65 74 67 72 61 |rc..shad|e setgra|
|00000710| 79 0d 20 09 66 69 6c 6c | 20 0d 67 72 65 73 74 6f |y. .fill| .gresto|
|00000720| 72 65 0d ff 00 16 0a 01 | f7 65 6e 64 70 73 ff 00 |re......|.endps..|
|00000730| 15 0a 00 f7 0d fc 00 6c | 02 0a 00 6c 00 0e 02 44 |.......l|...l...D|
|00000740| 06 30 f7 0d 0d 54 68 69 | 73 20 66 69 6c 65 20 73 |.0...Thi|s file s|
|00000750| 68 6f 75 6c 64 20 74 68 | 65 6e 20 62 65 20 73 61 |hould th|en be sa|
|00000760| 76 65 64 20 69 6e 74 6f | 20 61 20 66 69 6c 65 20 |ved into| a file |
|00000770| 73 75 63 68 20 61 73 20 | 63 69 72 63 6c 65 2e 70 |such as |circle.p|
|00000780| 73 77 2e 20 20 54 68 61 | 74 20 66 69 6c 65 20 63 |sw. Tha|t file c|
|00000790| 61 6e 20 74 68 65 6e 20 | 62 65 20 61 64 64 65 64 |an then |be added|
|000007a0| 20 74 6f 20 74 68 65 20 | 70 72 6f 6a 65 63 74 20 | to the |project |
|000007b0| 6d 61 6e 61 67 65 72 20 | 6f 66 20 49 6e 74 65 72 |manager |of Inter|
|000007c0| 66 61 63 65 20 42 75 69 | 6c 64 65 72 2e 20 20 0d |face Bui|lder. .|
|000007d0| fc 00 6c 02 0a 00 6c 02 | 0e 02 44 06 30 f7 0d 02 |..l...l.|..D.0...|
|000007e0| 80 0d 0d ff 00 15 0a 01 | f7 46 69 67 75 72 65 20 |........|.Figure |
|000007f0| 39 2d 31 3a 20 41 64 64 | 69 6e 67 20 61 20 50 6f |9-1: Add|ing a Po|
|00000800| 73 74 53 63 72 69 70 74 | 20 77 72 61 70 20 66 69 |stScript| wrap fi|
|00000810| 6c 65 20 74 6f 20 74 68 | 65 20 50 72 6f 6a 65 63 |le to th|e Projec|
|00000820| 74 20 4d 61 6e 61 67 65 | 72 ff 00 15 0a 00 f7 0d |t Manage|r.......|
|00000830| 0d fc 00 6c 02 0a 00 6c | 00 0e 02 44 06 30 f7 41 |...l...l|...D.0.A|
|00000840| 66 74 65 72 20 74 68 65 | 20 50 72 6f 6a 65 63 74 |fter the| Project|
|00000850| 20 4d 61 6e 61 67 65 72 | 20 69 73 20 73 65 6c 65 | Manager| is sele|
|00000860| 63 74 65 64 20 66 72 6f | 6d 20 74 68 65 20 49 6e |cted fro|m the In|
|00000870| 73 70 65 63 74 6f 72 20 | 57 69 6e 64 6f 77 2c 20 |spector |Window, |
|00000880| 20 74 68 65 20 41 64 64 | 2e 2e 2e 20 62 75 74 74 | the Add|... butt|
|00000890| 6f 6e 20 69 73 20 75 73 | 65 64 20 61 64 64 20 74 |on is us|ed add t|
|000008a0| 68 65 20 63 69 72 63 6c | 65 2e 70 73 77 20 66 69 |he circl|e.psw fi|
|000008b0| 6c 65 20 74 6f 20 74 68 | 65 20 70 72 6f 6a 65 63 |le to th|e projec|
|000008c0| 74 20 6d 61 6e 61 67 65 | 72 2e 20 20 54 6f 20 64 |t manage|r. To d|
|000008d0| 65 66 69 6e 65 20 74 68 | 65 20 74 79 70 65 73 20 |efine th|e types |
|000008e0| 77 65 20 77 6f 75 6c 64 | 20 61 6c 73 6f 20 6e 65 |we would| also ne|
|000008f0| 65 64 20 74 6f 20 69 6e | 63 6c 75 64 65 20 74 68 |ed to in|clude th|
|00000900| 65 20 66 69 6c 65 20 22 | 63 69 72 63 6c 65 2e 68 |e file "|circle.h|
|00000910| 22 20 69 6e 20 6f 75 72 | 20 69 6d 70 6c 65 6d 65 |" in our| impleme|
|00000920| 6e 74 61 74 69 6f 6e 20 | 66 69 6c 65 2e 20 20 54 |ntation |file. T|
|00000930| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 6c 69 6e |he follo|wing lin|
|00000940| 65 20 6d 75 73 74 20 74 | 68 65 6e 20 62 65 20 61 |e must t|hen be a|
|00000950| 64 64 65 64 20 74 6f 20 | 61 6c 6c 20 69 6d 70 6c |dded to |all impl|
|00000960| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 66 69 6c 65 73 |ementati|on files|
|00000970| 20 74 68 61 74 20 75 73 | 65 20 74 68 65 20 64 72 | that us|e the dr|
|00000980| 61 77 43 69 72 63 6c 65 | 20 66 75 6e 63 74 69 6f |awCircle| functio|
|00000990| 6e 3a 0d 0d fc 00 90 02 | 0a 00 90 00 0e 02 d4 06 |n:......|........|
|000009a0| 30 f7 ff 00 16 0a 00 f7 | 23 69 6d 70 6f 72 74 20 |0.......|#import |
|000009b0| 22 63 69 72 63 6c 65 2e | 68 22 0d ff 00 15 0a 00 |"circle.|h"......|
|000009c0| f7 fc 00 6c 02 0a 00 6c | 00 0e 02 44 06 30 f7 0d |...l...l|...D.0..|
|000009d0| 41 66 74 65 72 20 74 68 | 65 20 6d 61 6b 65 20 63 |After th|e make c|
|000009e0| 6f 6d 6d 61 6e 64 20 69 | 73 20 72 75 6e 20 74 68 |ommand i|s run th|
|000009f0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 63 6f 6d 70 |e follow|ing comp|
|00000a00| 69 6c 65 20 73 74 65 70 | 73 20 77 69 6c 6c 20 62 |ile step|s will b|
|00000a10| 65 20 65 78 65 63 75 74 | 65 64 3a 0d 0d 20 0d fc |e execut|ed:.. ..|
|00000a20| 00 91 02 0a 00 91 00 0e | 02 cc 06 30 f7 ff 00 16 |........|...0....|
|00000a30| 0a 00 f7 70 73 77 72 61 | 70 20 20 2d 61 20 2d 68 |...pswra|p -a -h|
|00000a40| 20 63 69 72 63 6c 65 2e | 68 20 2d 6f 20 63 69 72 | circle.|h -o cir|
|00000a50| 63 6c 65 2e 63 20 63 69 | 72 63 6c 65 2e 70 73 77 |cle.c ci|rcle.psw|
|00000a60| 0d 03 f6 0d fc 00 6c 02 | 0a 00 90 00 0e 02 d4 06 |......l.|........|
|00000a70| 30 f7 ff 00 16 0a 00 f7 | 23 69 6d 70 6f 72 74 20 |0.......|#import |
|00000a80| 22 4d 79 56 69 65 77 2e | 68 22 0d 23 69 6d 70 6f |"MyView.|h".#impo|
|00000a90| 72 74 20 3c 64 70 73 63 | 6c 69 65 6e 74 2f 77 72 |rt <dpsc|lient/wr|
|00000aa0| 61 70 73 2e 68 3e 0d 23 | 69 6d 70 6f 72 74 20 3c |aps.h>.#|import <|
|00000ab0| 61 70 70 6b 69 74 2f 43 | 6f 6e 74 72 6f 6c 2e 68 |appkit/C|ontrol.h|
|00000ac0| 3e 0d ff 00 16 0a 01 f7 | 23 69 6d 70 6f 72 74 20 |>.......|#import |
|00000ad0| 22 6c 69 6e 65 2e 68 22 | 0d 23 69 6d 70 6f 72 74 |"line.h"|.#import|
|00000ae0| 20 22 63 69 72 63 6c 65 | 2e 68 22 0d ff 00 16 0a | "circle|.h".....|
|00000af0| 00 f7 0d 40 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |...@impl|ementati|
|00000b00| 6f 6e 20 4d 79 56 69 65 | 77 0d 0d 2d 20 6d 79 53 |on MyVie|w..- myS|
|00000b10| 6c 69 64 65 72 3a 73 65 | 6e 64 65 72 0d 7b 0d 20 |lider:se|nder.{. |
|00000b20| 20 20 20 6d 79 46 6c 6f | 61 74 20 3d 20 5b 73 65 | myFlo|at = [se|
|00000b30| 6e 64 65 72 20 66 6c 6f | 61 74 56 61 6c 75 65 5d |nder flo|atValue]|
|00000b40| 3b 0d 20 20 20 20 5b 73 | 65 6c 66 20 64 69 73 70 |;. [s|elf disp|
|00000b50| 6c 61 79 5d 3b 0d 20 20 | 20 20 72 65 74 75 72 6e |lay];. | return|
|00000b60| 20 73 65 6c 66 3b 0d 7d | 0d 0d 2d 20 64 72 61 77 | self;.}|..- draw|
|00000b70| 53 65 6c 66 3a 28 4e 58 | 52 65 63 74 2a 29 72 20 |Self:(NX|Rect*)r |
|00000b80| 3a 28 69 6e 74 29 63 0d | 7b 0d 09 4e 58 45 72 61 |:(int)c.|{..NXEra|
|00000b90| 73 65 52 65 63 74 28 26 | 62 6f 75 6e 64 73 29 3b |seRect(&|bounds);|
|00000ba0| 0d 09 ff 00 16 0a 01 f7 | 50 53 6d 6f 76 65 74 6f |........|PSmoveto|
|00000bb0| 28 33 30 30 2e 30 2c 20 | 32 30 30 2e 30 29 3b 0d |(300.0, |200.0);.|
|00000bc0| 09 64 72 61 77 43 69 72 | 63 6c 65 28 35 30 2e 30 |.drawCir|cle(50.0|
|00000bd0| 2c 20 30 2e 33 33 33 29 | 3b 0d 20 09 ff 00 16 0a |, 0.333)|;. .....|
|00000be0| 00 f7 50 53 73 65 74 67 | 72 61 79 28 4e 58 5f 42 |..PSsetg|ray(NX_B|
|00000bf0| 4c 41 43 4b 29 3b 0d 09 | 50 53 73 65 74 6c 69 6e |LACK);..|PSsetlin|
|00000c00| 65 77 69 64 74 68 28 35 | 2e 30 29 3b 0d 09 ff 00 |ewidth(5|.0);....|
|00000c10| 16 0a 01 f7 64 6f 4c 69 | 6e 65 28 6d 79 46 6c 6f |....doLi|ne(myFlo|
|00000c20| 61 74 2a 31 2e 33 2c 20 | 6d 79 46 6c 6f 61 74 29 |at*1.3, |myFloat)|
|00000c30| 3b 0d 09 ff 00 16 0a 00 | f7 72 65 74 75 72 6e 20 |;.......|.return |
|00000c40| 73 65 6c 66 3b 0d 7d 0d | 0d fc 00 6c 02 0a 00 6c |self;.}.|...l...l|
|00000c50| 00 0e 02 44 06 30 f7 ff | 00 15 0a 00 f7 54 68 69 |...D.0..|.....Thi|
|00000c60| 73 20 66 69 6c 65 20 69 | 73 20 69 64 65 6e 74 69 |s file i|s identi|
|00000c70| 63 61 6c 20 74 6f 20 74 | 68 65 20 73 6c 69 64 65 |cal to t|he slide|
|00000c80| 72 20 65 78 61 6d 70 6c | 65 20 69 6e 20 74 68 65 |r exampl|e in the|
|00000c90| 20 75 73 65 64 20 69 6e | 20 74 68 65 20 6c 61 73 | used in| the las|
|00000ca0| 74 20 63 68 61 70 74 65 | 72 20 77 69 74 68 20 74 |t chapte|r with t|
|00000cb0| 68 65 20 6c 69 6e 65 73 | 20 69 6e 20 62 6f 6c 64 |he lines| in bold|
|00000cc0| 20 61 64 64 65 64 20 74 | 6f 20 72 65 70 6c 61 63 | added t|o replac|
|00000cd0| 65 20 74 68 65 20 50 53 | 20 66 75 6e 63 74 69 6f |e the PS| functio|
|00000ce0| 6e 73 2e 20 20 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |ns. The| followi|
|00000cf0| 6e 67 20 69 73 20 61 6c | 73 6f 20 75 73 65 64 20 |ng is al|so used |
|00000d00| 74 6f 20 72 65 70 6c 61 | 63 65 20 74 68 65 20 6c |to repla|ce the l|
|00000d10| 69 6e 65 20 64 72 61 77 | 20 66 75 6e 63 74 69 6f |ine draw| functio|
|00000d20| 6e ff 00 15 0a 00 f7 2e | 20 20 49 74 20 69 73 20 |n.......| It is |
|00000d30| 74 68 65 20 63 6f 6e 74 | 65 6e 74 73 20 6f 66 20 |the cont|ents of |
|00000d40| 74 68 65 20 66 69 6c 65 | 20 6c 69 6e 65 2e 70 73 |the file| line.ps|
|00000d50| 77 2e 0d 0d fc 00 90 02 | 0a 00 90 00 0e 02 d0 06 |w.......|........|
|00000d60| 30 f7 ff 00 16 0a 00 f7 | 64 65 66 69 6e 65 70 73 |0.......|defineps|
|00000d70| 20 64 6f 4c 69 6e 65 28 | 66 6c 6f 61 74 20 78 2c | doLine(|float x,|
|00000d80| 79 29 0d 20 20 20 20 35 | 20 73 65 74 6c 69 6e 65 |y). 5| setline|
|00000d90| 77 69 64 74 68 0d 20 20 | 20 20 6e 65 77 70 61 74 |width. | newpat|
|00000da0| 68 0d 20 20 20 20 20 20 | 20 32 30 30 20 31 30 20 |h. | 200 10 |
|00000db0| 6d 6f 76 65 74 6f 0d 20 | 20 20 20 20 20 20 78 20 |moveto. | x |
|00000dc0| 79 20 6c 69 6e 65 74 6f | 0d 20 20 20 20 73 74 72 |y lineto|. str|
|00000dd0| 6f 6b 65 0d 65 6e 64 70 | 73 0d 0d fc 00 6c 02 0a |oke.endp|s....l..|
|00000de0| 00 6c 00 0e 02 44 06 30 | f7 ff 00 15 0a 00 f7 54 |.l...D.0|.......T|
|00000df0| 68 65 20 72 65 73 75 6c | 74 20 69 73 20 74 68 65 |he resul|t is the|
|00000e00| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 70 72 6f 67 72 | followi|ng progr|
|00000e10| 61 6d 20 69 6e 20 77 68 | 69 63 68 20 74 68 65 20 |am in wh|ich the |
|00000e20| 6c 69 6e 65 20 6d 6f 76 | 65 73 20 6f 76 65 72 20 |line mov|es over |
|00000e30| 74 68 65 20 63 69 72 63 | 6c 65 20 61 73 20 74 68 |the circ|le as th|
|00000e40| 65 20 73 6c 69 64 65 72 | 20 69 73 20 6d 6f 76 65 |e slider| is move|
|00000e50| 64 ff 00 15 0a 00 f7 2e | 0d 00 16 0d 0d 0d 0d 0d |d.......|........|
|00000e60| fc 00 6c 02 0a 00 6c 02 | 0e 02 44 06 30 f7 0d 0d |..l...l.|..D.0...|
|00000e70| 0d 00 1d fb 00 00 00 01 | 00 e3 01 46 39 2d 32 5f |........|...F9-2_|
|00000e80| 70 73 77 2e 37 30 34 36 | 35 30 2e 65 70 73 f7 0d |psw.7046|50.eps..|
|00000e90| 00 02 0d 0d 02 b5 0d fc | 00 90 02 0a 00 90 00 0e |........|........|
|00000ea0| 02 d4 06 30 f7 ff 00 16 | 0a 01 f7 64 65 66 69 6e |...0....|...defin|
|00000eb0| 65 70 73 20 64 72 61 77 | 53 6c 69 63 65 20 28 66 |eps draw|Slice (f|
|00000ec0| 6c 6f 61 74 20 67 72 61 | 79 73 68 61 64 65 2c 20 |loat gra|yshade, |
|00000ed0| 72 61 64 69 75 73 2c 20 | 73 74 61 72 74 61 6e 67 |radius, |startang|
|00000ee0| 6c 65 2c 20 65 6e 64 61 | 6e 67 6c 65 2c 20 6c 61 |le, enda|ngle, la|
|00000ef0| 62 65 6c 70 73 3b 20 63 | 68 61 72 20 2a 74 68 65 |belps; c|har *the|
|00000f00| 6c 61 62 65 6c 29 0d ff | 00 16 0a 00 f7 20 20 20 |label)..|..... |
|00000f10| 20 31 20 73 65 74 6c 69 | 6e 65 77 69 64 74 68 0d | 1 setli|newidth.|
|00000f20| 20 20 20 20 6e 65 77 70 | 61 74 68 20 30 20 30 20 | newp|ath 0 0 |
|00000f30| 6d 6f 76 65 74 6f 0d 20 | 20 20 20 20 30 20 30 20 |moveto. | 0 0 |
|00000f40| 72 61 64 69 75 73 20 73 | 74 61 72 74 61 6e 67 6c |radius s|tartangl|
|00000f50| 65 20 65 6e 64 61 6e 67 | 6c 65 20 61 72 63 0d 20 |e endang|le arc. |
|00000f60| 20 20 63 6c 6f 73 65 70 | 61 74 68 0d 20 20 20 31 | closep|ath. 1|
|00000f70| 2e 34 31 35 20 73 65 74 | 6d 69 74 65 72 6c 69 6d |.415 set|miterlim|
|00000f80| 69 74 0d 20 20 20 67 73 | 61 76 65 0d 20 20 20 20 |it. gs|ave. |
|00000f90| 67 72 61 79 73 68 61 64 | 65 20 73 65 74 67 72 61 |grayshad|e setgra|
|00000fa0| 79 0d 20 20 20 20 66 69 | 6c 6c 0d 20 20 20 67 72 |y. fi|ll. gr|
|00000fb0| 65 73 74 6f 72 65 0d 20 | 20 20 73 74 72 6f 6b 65 |estore. | stroke|
|00000fc0| 0d 20 20 20 67 73 61 76 | 65 0d 20 20 20 20 73 74 |. gsav|e. st|
|00000fd0| 61 72 74 61 6e 67 6c 65 | 20 65 6e 64 61 6e 67 6c |artangle| endangl|
|00000fe0| 65 20 61 64 64 20 32 20 | 64 69 76 20 72 6f 74 61 |e add 2 |div rota|
|00000ff0| 74 65 0d 0d 20 20 20 20 | 72 61 64 69 75 73 20 30 |te.. |radius 0|
|00001000| 20 74 72 61 6e 73 6c 61 | 74 65 0d 20 20 20 20 6e | transla|te. n|
|00001010| 65 77 70 61 74 68 0d 20 | 20 20 20 20 20 30 20 30 |ewpath. | 0 0|
|00001020| 20 6d 6f 76 65 74 6f 20 | 6c 61 62 65 6c 70 73 20 | moveto |labelps |
|00001030| 2e 38 20 6d 75 6c 20 30 | 20 6c 69 6e 65 74 6f 20 |.8 mul 0| lineto |
|00001040| 73 74 72 6f 6b 65 0d 20 | 20 20 20 6c 61 62 65 6c |stroke. | label|
|00001050| 70 73 20 30 20 74 72 61 | 6e 73 6c 61 74 65 0d 20 |ps 0 tra|nslate. |
|00001060| 20 20 20 30 20 30 20 74 | 72 61 6e 73 66 6f 72 6d | 0 0 t|ransform|
|00001070| 0d 20 20 20 67 72 65 73 | 74 6f 72 65 0d 20 20 20 |. gres|tore. |
|00001080| 69 74 72 61 6e 73 66 6f | 72 6d 0d 20 20 20 2f 79 |itransfo|rm. /y|
|00001090| 20 65 78 63 68 20 64 65 | 66 20 2f 78 20 65 78 63 | exch de|f /x exc|
|000010a0| 68 20 64 65 66 0d 20 20 | 20 78 20 79 20 6d 6f 76 |h def. | x y mov|
|000010b0| 65 74 6f 0d 0d 20 20 20 | 78 20 30 20 6c 74 0d 20 |eto.. |x 0 lt. |
|000010c0| 20 20 20 20 20 7b 20 28 | 74 68 65 6c 61 62 65 6c | { (|thelabel|
|000010d0| 29 20 73 74 72 69 6e 67 | 77 69 64 74 68 20 70 6f |) string|width po|
|000010e0| 70 20 6e 65 67 20 30 20 | 72 6d 6f 76 65 74 6f 20 |p neg 0 |rmoveto |
|000010f0| 7d 0d 20 20 20 20 20 20 | 69 66 0d 20 20 20 20 79 |}. |if. y|
|00001100| 20 30 20 6c 74 20 7b 20 | 30 20 6c 61 62 65 6c 70 | 0 lt { |0 labelp|
|00001110| 73 20 6e 65 67 20 72 6d | 6f 76 65 74 6f 20 7d 20 |s neg rm|oveto } |
|00001120| 69 66 0d 20 20 20 20 28 | 74 68 65 6c 61 62 65 6c |if. (|thelabel|
|00001130| 29 20 73 68 6f 77 0d ff | 00 16 0a 01 f7 65 6e 64 |) show..|.....end|
|00001140| 70 73 ff 00 15 0a 00 f7 | 0d 0d 0d 00 31 fc 00 5a |ps......|....1..Z|
|00001150| 02 0a 00 5a 02 0e 02 d4 | 06 30 f7 fb 00 00 00 01 |...Z....|.0......|
|00001160| 01 0e 01 74 39 2d 33 5f | 70 69 65 5f 73 6c 69 63 |...t9-3_|pie_slic|
|00001170| 65 2e 37 36 33 36 39 34 | 2e 65 70 73 f7 0d 03 35 |e.763694|.eps...5|
|00001180| ff 00 15 0a 00 f7 fc 00 | 90 02 0a 00 90 00 0e 02 |........|........|
|00001190| d4 06 30 f7 0d ff 00 16 | 0a 00 f7 23 69 6d 70 6f |..0.....|...#impo|
|000011a0| 72 74 20 22 50 69 65 56 | 69 65 77 2e 68 22 0d 23 |rt "PieV|iew.h".#|
|000011b0| 69 6d 70 6f 72 74 20 3c | 64 70 73 63 6c 69 65 6e |import <|dpsclien|
|000011c0| 74 2f 77 72 61 70 73 2e | 68 3e 0d 23 69 6d 70 6f |t/wraps.|h>.#impo|
|000011d0| 72 74 20 3c 61 70 70 6b | 69 74 2f 43 6f 6e 74 72 |rt <appk|it/Contr|
|000011e0| 6f 6c 2e 68 3e 0d 23 69 | 6d 70 6f 72 74 20 22 73 |ol.h>.#i|mport "s|
|000011f0| 6c 69 63 65 2e 68 22 0d | 0d 40 69 6d 70 6c 65 6d |lice.h".|.@implem|
|00001200| 65 6e 74 61 74 69 6f 6e | 20 50 69 65 56 69 65 77 |entation| PieView|
|00001210| 0d 0d 2b 6e 65 77 46 72 | 61 6d 65 3a 28 63 6f 6e |..+newFr|ame:(con|
|00001220| 73 74 20 4e 58 52 65 63 | 74 20 2a 29 74 46 0d 7b |st NXRec|t *)tF.{|
|00001230| 0d 20 20 20 73 65 6c 66 | 20 3d 20 5b 73 75 70 65 |. self| = [supe|
|00001240| 72 20 6e 65 77 46 72 61 | 6d 65 3a 74 46 5d 3b 0d |r newFra|me:tF];.|
|00001250| 20 20 20 5b 73 65 6c 66 | 20 74 72 61 6e 73 6c 61 | [self| transla|
|00001260| 74 65 3a 62 6f 75 6e 64 | 73 2e 73 69 7a 65 2e 77 |te:bound|s.size.w|
|00001270| 69 64 74 68 2f 32 2e 30 | 20 09 3a 62 6f 75 6e 64 |idth/2.0| .:bound|
|00001280| 73 2e 73 69 7a 65 2e 68 | 65 69 67 68 74 2f 32 2e |s.size.h|eight/2.|
|00001290| 30 5d 3b 0d 20 20 20 6d | 79 4c 61 62 65 6c 20 3d |0];. m|yLabel =|
|000012a0| 20 22 22 3b 0d 20 20 20 | 72 65 74 75 72 6e 20 73 | "";. |return s|
|000012b0| 65 6c 66 3b 0d 7d 0d 0d | 2d 20 67 65 74 53 6c 69 |elf;.}..|- getSli|
|000012c0| 64 65 72 3a 73 65 6e 64 | 65 72 0d 7b 0d 20 20 20 |der:send|er.{. |
|000012d0| 20 6d 79 46 6c 6f 61 74 | 20 3d 20 5b 73 65 6e 64 | myFloat| = [send|
|000012e0| 65 72 20 66 6c 6f 61 74 | 56 61 6c 75 65 5d 3b 0d |er float|Value];.|
|000012f0| 20 20 20 20 5b 73 65 6c | 66 20 64 69 73 70 6c 61 | [sel|f displa|
|00001300| 79 5d 3b 0d 20 20 20 20 | 72 65 74 75 72 6e 20 73 |y];. |return s|
|00001310| 65 6c 66 3b 0d 7d 0d 0d | 2d 20 67 65 74 4c 61 62 |elf;.}..|- getLab|
|00001320| 65 6c 3a 73 65 6e 64 65 | 72 0d 7b 0d 20 20 20 20 |el:sende|r.{. |
|00001330| 6d 79 4c 61 62 65 6c 20 | 3d 20 5b 6d 79 54 65 78 |myLabel |= [myTex|
|00001340| 74 20 73 74 72 69 6e 67 | 56 61 6c 75 65 5d 3b 0d |t string|Value];.|
|00001350| 20 20 20 20 5b 73 65 6c | 66 20 64 69 73 70 6c 61 | [sel|f displa|
|00001360| 79 5d 3b 0d 20 20 20 20 | 72 65 74 75 72 6e 20 73 |y];. |return s|
|00001370| 65 6c 66 3b 0d 7d 0d 0d | fc 00 90 02 1d 00 90 00 |elf;.}..|........|
|00001380| 0e 02 d4 06 30 f7 2d 20 | 64 72 61 77 53 65 6c 66 |....0.- |drawSelf|
|00001390| 3a 28 4e 58 52 65 63 74 | 2a 29 72 20 3a 28 69 6e |:(NXRect|*)r :(in|
|000013a0| 74 29 63 0d 7b 0d 20 20 | 20 20 4e 58 45 72 61 73 |t)c.{. | NXEras|
|000013b0| 65 52 65 63 74 28 26 62 | 6f 75 6e 64 73 29 3b 0d |eRect(&b|ounds);.|
|000013c0| 20 20 20 20 50 53 73 65 | 6c 65 63 74 66 6f 6e 74 | PSse|lectfont|
|000013d0| 28 22 48 65 6c 76 65 74 | 69 63 61 22 2c 20 31 36 |("Helvet|ica", 16|
|000013e0| 2e 30 29 3b 0d 20 20 20 | 20 2f 2f 20 35 30 25 20 |.0);. | // 50% |
|000013f0| 67 72 61 79 2c 20 72 61 | 64 69 75 73 20 3d 20 38 |gray, ra|dius = 8|
|00001400| 30 20 75 6e 69 74 73 2c | 20 73 74 61 72 74 20 61 |0 units,| start a|
|00001410| 20 30 20 64 65 67 72 65 | 65 73 20 74 6f 20 6d 79 | 0 degre|es to my|
|00001420| 46 6c 6f 61 74 0d 20 20 | 20 20 2f 2f 20 6c 61 62 |Float. | // lab|
|00001430| 65 6c 20 6c 65 6e 67 74 | 68 20 3d 20 32 30 20 75 |el lengt|h = 20 u|
|00001440| 6e 69 74 73 2c 20 6c 61 | 62 65 6c 20 74 65 78 74 |nits, la|bel text|
|00001450| 0d 20 20 20 20 64 72 61 | 77 53 6c 69 63 65 28 30 |. dra|wSlice(0|
|00001460| 2e 35 2c 20 38 30 2e 30 | 2c 20 30 2e 30 2c 20 6d |.5, 80.0|, 0.0, m|
|00001470| 79 46 6c 6f 61 74 2c 20 | 32 30 2e 30 2c 20 6d 79 |yFloat, |20.0, my|
|00001480| 4c 61 62 65 6c 29 3b 0d | 20 20 20 20 72 65 74 75 |Label);.| retu|
|00001490| 72 6e 20 73 65 6c 66 3b | 0d fc 00 90 02 0a 00 90 |rn self;|........|
|000014a0| 00 0e 02 d4 06 30 f7 7d | 0d 0d 40 65 6e 64 ff 00 |.....0.}|..@end..|
|000014b0| 15 0a 00 f7 0d 02 89 fc | 00 6c 02 0a 00 6c 00 0e |........|.l...l..|
|000014c0| 02 d4 06 30 f7 48 65 72 | 65 20 69 73 20 61 20 73 |...0.Her|e is a s|
|000014d0| 61 6d 70 6c 65 20 61 70 | 70 6c 69 63 61 74 69 6f |ample ap|plicatio|
|000014e0| 6e 20 74 6f 20 64 65 6d | 6f 6e 73 74 72 61 74 65 |n to dem|onstrate|
|000014f0| 20 69 74 73 20 66 75 6e | 63 74 69 6f 6e 73 2e 20 | its fun|ctions. |
|00001500| 20 57 65 20 77 69 6c 6c | 20 63 72 65 61 74 65 20 | We will| create |
|00001510| 61 20 73 75 62 63 6c 61 | 73 73 20 6f 66 20 56 69 |a subcla|ss of Vi|
|00001520| 65 77 20 63 61 6c 6c 65 | 64 20 50 69 65 56 69 65 |ew calle|d PieVie|
|00001530| 77 2e 20 20 20 49 74 20 | 77 69 6c 6c 20 68 61 76 |w. It |will hav|
|00001540| 65 20 74 77 6f 20 61 63 | 74 69 6f 6e 20 6d 65 74 |e two ac|tion met|
|00001550| 68 6f 64 73 20 66 72 6f | 6d 20 61 20 73 6c 69 64 |hods fro|m a slid|
|00001560| 65 72 20 61 6e 64 20 61 | 20 66 6f 72 6d 20 6f 62 |er and a| form ob|
|00001570| 6a 65 63 74 2e 20 20 54 | 68 65 20 73 6c 69 64 65 |ject. T|he slide|
|00001580| 72 20 77 65 20 77 69 6c | 6c 20 75 73 65 20 74 6f |r we wil|l use to|
|00001590| 20 63 6f 6e 74 72 6f 6c | 20 74 68 65 20 76 61 6c | control| the val|
|000015a0| 75 65 20 6f 66 20 74 68 | 65 20 77 65 64 67 65 20 |ue of th|e wedge |
|000015b0| 28 69 6e 20 64 65 67 72 | 65 65 73 29 20 61 6e 64 |(in degr|ees) and|
|000015c0| 20 74 68 65 20 46 6f 72 | 6d 20 77 69 6c 6c 20 68 | the For|m will h|
|000015d0| 6f 6c 64 20 74 68 65 20 | 74 65 78 74 20 6f 66 20 |old the |text of |
|000015e0| 74 68 65 20 6c 61 62 65 | 6c 20 66 6f 72 20 74 68 |the labe|l for th|
|000015f0| 65 20 77 65 64 67 65 2e | 20 20 4d 65 20 6d 75 73 |e wedge.| Me mus|
|00001600| 74 20 6d 61 6b 65 20 73 | 75 72 65 20 74 6f 20 63 |t make s|ure to c|
|00001610| 68 61 6e 67 65 20 74 68 | 65 20 64 65 66 61 75 6c |hange th|e defaul|
|00001620| 74 20 76 61 6c 75 65 73 | 20 6f 66 20 74 68 65 20 |t values| of the |
|00001630| 73 6c 69 64 65 72 20 74 | 6f 20 62 65 20 30 20 74 |slider t|o be 0 t|
|00001640| 6f 20 33 36 30 2e 30 2e | 20 20 54 68 65 20 68 65 |o 360.0.| The he|
|00001650| 61 64 65 72 20 66 69 6c | 65 20 77 69 6c 6c 20 62 |ader fil|e will b|
|00001660| 65 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 3a |e the fo|llowing:|
|00001670| 0d fc 00 90 02 0a 00 90 | 00 0e 02 d4 06 30 f7 0d |........|.....0..|
|00001680| ff 00 16 0a 00 f7 23 69 | 6d 70 6f 72 74 20 3c 61 |......#i|mport <a|
|00001690| 70 70 6b 69 74 2f 56 69 | 65 77 2e 68 3e 0d 23 69 |ppkit/Vi|ew.h>.#i|
|000016a0| 6d 70 6f 72 74 20 3c 61 | 70 70 6b 69 74 2f 53 6c |mport <a|ppkit/Sl|
|000016b0| 69 64 65 72 2e 68 3e 0d | 0d 40 69 6e 74 65 72 66 |ider.h>.|.@interf|
|000016c0| 61 63 65 20 50 69 65 56 | 69 65 77 3a 56 69 65 77 |ace PieV|iew:View|
|000016d0| 0d 7b 0d 20 20 20 20 69 | 64 20 6d 79 54 65 78 74 |.{. i|d myText|
|000016e0| 3b 0d 20 20 20 20 66 6c | 6f 61 74 20 6d 79 46 6c |;. fl|oat myFl|
|000016f0| 6f 61 74 3b 0d 20 20 20 | 20 63 68 61 72 20 2a 6d |oat;. | char *m|
|00001700| 79 4c 61 62 65 6c 3b 0d | 7d 0d 0d 2b 20 6e 65 77 |yLabel;.|}..+ new|
|00001710| 46 72 61 6d 65 3a 28 63 | 6f 6e 73 74 20 4e 58 52 |Frame:(c|onst NXR|
|00001720| 65 63 74 20 2a 29 74 46 | 3b 0d 2d 20 73 65 74 4d |ect *)tF|;.- setM|
|00001730| 79 54 65 78 74 3a 61 6e | 4f 62 6a 65 63 74 3b 0d |yText:an|Object;.|
|00001740| 01 b5 2d 20 67 65 74 53 | 6c 69 64 65 72 3a 73 65 |..- getS|lider:se|
|00001750| 6e 64 65 72 3b 0d 2d 20 | 67 65 74 4c 61 62 65 6c |nder;.- |getLabel|
|00001760| 3a 73 65 6e 64 65 72 3b | 0d 0d 40 65 6e 64 0d 0d |:sender;|..@end..|
|00001770| fc 00 6c 02 0a 00 6c 00 | 0e 02 d4 06 30 f7 ff 00 |..l...l.|....0...|
|00001780| 15 0a 00 f7 57 65 20 63 | 61 6e 20 73 65 65 20 77 |....We c|an see w|
|00001790| 65 20 68 61 76 65 20 6f | 6e 65 20 6f 75 74 6c 65 |e have o|ne outle|
|000017a0| 74 20 28 73 65 74 4d 79 | 54 65 78 74 29 20 61 6e |t (setMy|Text) an|
|000017b0| 64 ff 00 15 0a 00 f7 20 | 74 77 6f 20 61 63 74 69 |d...... |two acti|
|000017c0| 6f 6e 20 6d 65 74 68 6f | 64 73 2c 20 6f 6e 65 20 |on metho|ds, one |
|000017d0| 69 66 20 74 68 65 20 73 | 6c 69 64 65 72 20 69 73 |if the s|lider is|
|000017e0| 20 6d 6f 76 65 64 20 28 | 67 65 74 53 6c 69 64 65 | moved (|getSlide|
|000017f0| 72 29 20 61 6e 64 20 6f | 6e 65 20 69 66 20 74 68 |r) and o|ne if th|
|00001800| 65 20 72 65 74 75 72 6e | 20 63 68 61 72 61 63 74 |e return| charact|
|00001810| 65 72 20 69 73 20 65 6e | 74 65 72 65 64 20 61 66 |er is en|tered af|
|00001820| 74 65 72 20 74 68 65 20 | 6c 61 62 65 6c 20 68 61 |ter the |label ha|
|00001830| 73 20 62 65 65 6e 20 63 | 68 61 6e 67 65 64 20 28 |s been c|hanged (|
|00001840| 67 65 74 6c 61 62 65 6c | 29 2e ff 00 15 0a 00 f7 |getlabel|).......|
|00001850| 20 57 65 20 77 69 6c 6c | 20 75 73 65 20 6f 6e 65 | We will| use one|
|00001860| 20 6f 75 74 6c 65 74 20 | 74 6f 20 67 65 74 20 74 | outlet |to get t|
|00001870| 68 65 20 6e 61 6d 65 20 | 6f 66 20 74 68 65 20 46 |he name |of the F|
|00001880| 6f 72 6d 20 6f 62 6a 65 | 63 74 20 77 68 69 63 68 |orm obje|ct which|
|00001890| 20 77 65 20 77 69 6c 6c | 20 6e 65 65 64 20 74 6f | we will| need to|
|000018a0| 20 64 69 73 70 6c 61 79 | 20 74 68 65 20 73 74 72 | display| the str|
|000018b0| 69 6e 67 20 75 73 65 64 | 20 69 6e 20 74 68 65 20 |ing used| in the |
|000018c0| 6c 61 62 65 6c 2e 20 20 | 54 68 65 20 69 6d 70 6c |label. |The impl|
|000018d0| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 66 69 6c 65 20 |ementati|on file |
|000018e0| 69 73 20 6c 69 73 74 65 | 64 20 62 65 6c 6f 77 3a |is liste|d below:|
|000018f0| ff 00 16 0a 00 f7 0d 00 | 60 fc 00 6c 02 0a 00 6c |........|`..l...l|
|00001900| 00 0e 02 d4 06 30 f7 57 | 68 65 6e 20 74 68 65 20 |.....0.W|hen the |
|00001910| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 69 73 20 72 |applicat|ion is r|
|00001920| 75 6e 6e 69 6e 67 20 69 | 74 20 68 61 73 20 74 68 |unning i|t has th|
|00001930| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 6d 61 69 6e |e follow|ing main|
|00001940| 20 77 69 6e 64 6f 77 3a | 0d fc 00 90 02 0a 00 90 | window:|........|
|00001950| 02 0e 02 d4 06 30 f7 0d | 0d 00 28 fc 00 6c 02 0a |.....0..|..(..l..|
|00001960| 00 6c 02 0e 02 44 06 30 | f7 fb 00 00 00 01 00 d8 |.l...D.0|........|
|00001970| 01 68 74 72 65 65 2e 35 | 35 38 33 37 36 2e 65 70 |.htree.5|58376.ep|
|00001980| 73 f7 0d 02 52 0d 25 20 | 46 72 6f 6d 20 70 67 20 |s...R.% |From pg |
|00001990| 37 34 20 6f 66 20 74 68 | 65 20 22 42 6c 75 65 20 |74 of th|e "Blue |
|000019a0| 42 6f 6f 6b 22 0d 25 20 | 43 68 61 6e 67 65 20 70 |Book".% |Change p|
|000019b0| 61 72 61 6d 65 74 65 72 | 73 20 66 6f 72 20 77 69 |arameter|s for wi|
|000019c0| 6c 64 20 65 66 66 65 63 | 74 73 2e 2e 2e 0d 0d 2f |ld effec|ts...../|
|000019d0| 64 65 70 74 68 20 30 20 | 64 65 66 0d 2f 6d 61 78 |depth 0 |def./max|
|000019e0| 64 65 70 74 68 20 31 30 | 20 64 65 66 0d 2f 64 6f |depth 10| def./do|
|000019f0| 77 6e 20 7b 2f 64 65 70 | 74 68 20 64 65 70 74 68 |wn {/dep|th depth|
|00001a00| 20 31 20 61 64 64 20 64 | 65 66 7d 20 64 65 66 0d | 1 add d|ef} def.|
|00001a10| 2f 75 70 20 20 20 7b 2f | 64 65 70 74 68 20 64 65 |/up {/|depth de|
|00001a20| 70 74 68 20 31 20 73 75 | 62 20 64 65 66 7d 20 64 |pth 1 su|b def} d|
|00001a30| 65 66 0d 0d 2f 64 6f 4c | 69 6e 65 20 25 20 56 65 |ef../doL|ine % Ve|
|00001a40| 72 74 69 63 61 6c 20 6c | 69 6e 65 0d 7b 30 20 31 |rtical l|ine.{0 1|
|00001a50| 34 34 20 72 6c 69 6e 65 | 74 6f 20 63 75 72 72 65 |44 rline|to curre|
|00001a60| 6e 74 70 6f 69 6e 74 20 | 73 74 72 6f 6b 65 20 74 |ntpoint |stroke t|
|00001a70| 72 61 6e 73 6c 61 74 65 | 20 30 20 30 20 6d 6f 76 |ranslate| 0 0 mov|
|00001a80| 65 74 6f 7d 0d 64 65 66 | 0d 0d 2f 66 72 61 63 74 |eto}.def|../fract|
|00001a90| 41 72 72 6f 77 20 0d 7b | 67 73 61 76 65 20 30 2e |Arrow .{|gsave 0.|
|00001aa0| 36 35 20 30 2e 36 35 20 | 73 63 61 6c 65 20 31 30 |65 0.65 |scale 10|
|00001ab0| 20 73 65 74 6c 69 6e 65 | 77 69 64 74 68 0d 20 64 | setline|width. d|
|00001ac0| 6f 77 6e 20 64 6f 4c 69 | 6e 65 0d 20 64 65 70 74 |own doLi|ne. dept|
|00001ad0| 68 20 6d 61 78 64 65 70 | 74 68 20 6c 65 20 0d 20 |h maxdep|th le . |
|00001ae0| 20 7b 31 33 35 20 72 6f | 74 61 74 65 20 66 72 61 | {135 ro|tate fra|
|00001af0| 63 74 41 72 72 6f 77 20 | 2d 32 37 30 20 72 6f 74 |ctArrow |-270 rot|
|00001b00| 61 74 65 20 66 72 61 63 | 74 41 72 72 6f 77 7d 0d |ate frac|tArrow}.|
|00001b10| 20 69 66 0d 20 75 70 20 | 67 72 65 73 74 6f 72 65 | if. up |grestore|
|00001b20| 7d 0d 64 65 66 0d 0d 25 | 20 22 4d 61 69 6e 22 20 |}.def..%| "Main" |
|00001b30| 70 72 6f 67 72 61 6d 0d | 32 34 30 20 30 20 6d 6f |program.|240 0 mo|
|00001b40| 76 65 74 6f 20 33 20 33 | 20 73 63 61 6c 65 20 66 |veto 3 3| scale f|
|00001b50| 72 61 63 74 41 72 72 6f | 77 20 30 2e 35 20 73 65 |ractArro|w 0.5 se|
|00001b60| 74 67 72 61 79 20 73 74 | 72 6f 6b 65 20 0d 0d 0d |tgray st|roke ...|
|00001b70| fc 00 91 02 0a 00 6c 00 | 0e 02 44 06 30 f7 ff 00 |......l.|..D.0...|
|00001b80| 15 0a 00 f7 54 68 69 73 | 20 70 72 6f 67 72 61 6d |....This| program|
|00001b90| 20 77 69 6c 6c 20 70 72 | 6f 64 75 63 65 20 74 68 | will pr|oduce th|
|00001ba0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 70 69 63 74 |e follow|ing pict|
|00001bb0| 75 72 65 20 77 68 65 6e | 20 76 69 65 77 65 64 20 |ure when| viewed |
|00001bc0| 77 69 74 68 20 50 72 65 | 76 69 65 77 20 6f 72 20 |with Pre|view or |
|00001bd0| 59 41 50 2e 0d 0d 0d 00 | 1f fb 00 00 00 01 01 37 |YAP.....|.......7|
|00001be0| 01 00 57 4e 47 72 61 70 | 68 69 63 2e 38 39 30 33 |..WNGrap|hic.8903|
|00001bf0| 33 30 2e 65 70 73 f7 0d | 00 21 0d 50 61 67 65 20 |30.eps..|.!.Page |
|00001c00| 39 2d fd 00 f7 20 20 20 | 20 20 20 20 fd 01 f7 20 |9-... | ... |
|00001c10| 20 20 20 20 20 20 fd 02 | f7 0d 0d 02 cc fc 00 48 | ..|.......H|
|00001c20| 02 0a 00 48 00 0e 01 b0 | 06 30 f7 ff 00 15 24 00 |...H....|.0....$.|
|00001c30| f7 f5 f6 ff 00 15 24 01 | f7 43 68 61 70 74 65 72 |......$.|.Chapter|
|00001c40| 20 39 3a 20 4d 6f 72 65 | 20 44 72 61 77 69 6e 67 | 9: More| Drawing|
|00001c50| ff 00 15 0c 00 f7 0d fc | 00 5a 02 0a 00 5a 00 0e |........|.Z...Z..|
|00001c60| 01 b0 06 30 f7 0d 0d 0d | 0d 0d 0d 0d 0d 0d ff 00 |...0....|........|
|00001c70| 15 0c 02 f7 0d 0d ff 00 | 15 24 01 f7 0d ff 00 15 |........|.$......|
|00001c80| 18 01 f7 ff 00 15 0c 02 | f7 0d fc 00 90 01 e6 00 |........|........|
|00001c90| 90 00 0e 02 b0 06 30 f7 | 50 75 74 20 61 20 71 75 |......0.|Put a qu|
|00001ca0| 69 74 65 20 68 65 72 65 | 2e 0d 20 20 20 20 2d 20 |ite here|.. - |
|00001cb0| 41 75 74 68 6f 72 0d 31 | 32 20 70 74 20 68 65 6c |Author.1|2 pt hel|
|00001cc0| 76 65 74 69 63 61 20 69 | 74 61 6c 69 63 73 20 32 |vetica i|talics 2|
|00001cd0| 20 69 6e 63 68 20 6d 61 | 72 67 69 6e ff 00 15 0c | inch ma|rgin....|
|00001ce0| 00 f7 0d fc 00 7e 01 e6 | 00 7e 00 0e 02 b0 06 30 |.....~..|.~.....0|
|00001cf0| f7 0d fc 00 6c 02 0a 00 | 6c 00 0e 02 44 06 30 f7 |....l...|l...D.0.|
|00001d00| ff 00 15 0a 00 f7 49 6e | 20 74 68 65 20 6c 61 73 |......In| the las|
|00001d10| 74 20 63 68 61 70 74 65 | 72 20 77 65 20 69 6e 74 |t chapte|r we int|
|00001d20| 72 6f 64 75 63 65 64 20 | 73 6f 6d 65 20 73 69 6d |roduced |some sim|
|00001d30| 70 6c 65 20 64 72 61 77 | 69 6e 67 20 63 6f 6d 6d |ple draw|ing comm|
|00001d40| 61 6e 64 73 ff 00 15 0a | 00 f7 20 61 6e 64 20 68 |ands....|.. and h|
|00001d50| 6f 77 20 74 6f 20 69 6e | 74 65 67 72 61 74 65 20 |ow to in|tegrate |
|00001d60| 74 68 65 6d 20 69 6e 74 | 6f 20 61 6e 20 6f 62 6a |them int|o an obj|
|00001d70| 65 63 74 2e 20 20 4e 6f | 77 20 77 65 20 77 69 6c |ect. No|w we wil|
|00001d80| 6c 20 6c 6f 6f 6b 20 61 | 74 20 74 77 6f 20 61 64 |l look a|t two ad|
|00001d90| 64 69 74 69 6f 6e 61 6c | 20 74 6f 70 69 63 73 3a |ditional| topics:|
|00001da0| 20 69 6e 69 74 69 61 6c | 69 7a 69 6e 67 20 74 68 | initial|izing th|
|00001db0| 65 20 73 74 61 74 65 73 | 20 6f 66 20 6f 62 6a 65 |e states| of obje|
|00001dc0| 63 74 73 20 74 68 61 74 | 20 61 72 65 20 61 20 73 |cts that| are a s|
|00001dd0| 75 62 2d 63 6c 61 73 73 | 20 6f 66 20 74 68 65 20 |ub-class| of the |
|00001de0| 56 69 65 77 20 63 6c 61 | 73 73 20 61 6e 64 20 68 |View cla|ss and h|
|00001df0| 6f 77 20 74 6f 20 74 61 | 6b 65 20 61 20 66 69 6c |ow to ta|ke a fil|
|00001e00| 65 20 6f 66 20 70 75 72 | 65 20 50 6f 73 74 53 63 |e of pur|e PostSc|
|00001e10| 72 69 70 74 20 63 6f 6d | 6d 61 6e 64 73 20 61 6e |ript com|mands an|
|00001e20| 64 20 75 73 65 20 74 68 | 61 74 20 64 72 61 77 20 |d use th|at draw |
|00001e30| 61 6e 20 6f 62 6a 65 63 | 74 2e 20 20 4f 6e 63 65 |an objec|t. Once|
|00001e40| 20 77 65 20 68 61 76 65 | 20 74 68 65 73 65 20 74 | we have| these t|
|00001e50| 77 6f 20 74 6f 70 69 63 | 73 20 75 6e 64 65 72 20 |wo topic|s under |
|00001e60| 6f 75 72 20 62 65 6c 74 | 20 77 65 20 77 69 6c 6c |our belt| we will|
|00001e70| 20 62 65 20 61 62 6c 65 | 20 74 6f 20 64 6f 20 73 | be able| to do s|
|00001e80| 6f 6d 65 20 72 65 61 6c | 6c 79 20 65 78 63 69 74 |ome real|ly excit|
|00001e90| 69 6e 67 20 70 72 6f 67 | 72 61 6d 73 2e 0d 0d fc |ing prog|rams....|
|00001ea0| 00 48 02 0a 00 48 00 0e | 02 44 06 30 f7 ff 00 15 |.H...H..|.D.0....|
|00001eb0| 18 01 f7 f9 00 f7 49 6e | 69 74 69 61 6c 69 7a 69 |......In|itializi|
|00001ec0| 6e 67 20 56 69 65 77 73 | 3a 20 6e 65 77 46 72 61 |ng Views|: newFra|
|00001ed0| 6d 65 3a 0d fc 00 6c 02 | 0a 00 6c 00 0e 02 44 06 |me:...l.|..l...D.|
|00001ee0| 30 f7 ff 00 15 0a 00 f7 | 0d 04 4f 49 6e 20 63 68 |0.......|..OIn ch|
|00001ef0| 61 70 74 65 72 20 73 65 | 76 65 6e 20 77 65 20 6c |apter se|ven we l|
|00001f00| 65 61 72 6e 65 64 20 68 | 6f 77 20 74 6f 20 69 6e |earned h|ow to in|
|00001f10| 69 74 69 61 6c 69 7a 65 | 20 74 68 65 20 73 74 61 |itialize| the sta|
|00001f20| 74 65 20 6f 66 20 6f 75 | 72 20 6f 62 6a 65 63 74 |te of ou|r object|
|00001f30| 73 20 61 73 20 74 68 65 | 79 20 77 65 72 65 20 6d |s as the|y were m|
|00001f40| 61 6e 75 66 61 63 74 75 | 72 65 64 20 69 6e 20 74 |anufactu|red in t|
|00001f50| 68 65 20 6f 62 6a 65 63 | 74 20 66 61 63 74 6f 72 |he objec|t factor|
|00001f60| 79 2e 20 20 57 65 20 61 | 64 64 65 64 20 61 20 6e |y. We a|dded a n|
|00001f70| 65 77 20 63 6c 61 73 73 | 20 6d 65 74 68 6f 64 20 |ew class| method |
|00001f80| 74 6f 20 6f 75 72 20 6f | 77 6e 20 6f 62 6a 65 63 |to our o|wn objec|
|00001f90| 74 27 73 20 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |t's impl|ementati|
|00001fa0| 6f 6e 20 66 69 6c 65 20 | 61 6e 64 20 74 68 65 6e |on file |and then|
|00001fb0| 20 73 65 6e 74 20 61 20 | 6d 65 73 73 61 67 65 20 | sent a |message |
|00001fc0| 74 6f 20 6f 75 72 20 73 | 75 70 65 72 2d 63 6c 61 |to our s|uper-cla|
|00001fd0| 73 73 20 74 6f 20 72 65 | 2d 75 73 65 20 74 68 65 |ss to re|-use the|
|00001fe0| 20 6e 65 77 20 6d 65 74 | 68 6f 64 20 61 6c 72 65 | new met|hod alre|
|00001ff0| 61 64 79 20 63 72 65 61 | 74 65 64 2e 20 20 42 75 |ady crea|ted. Bu|
|00002000| 74 20 74 68 65 72 65 20 | 69 73 20 6f 6e 65 20 64 |t there |is one d|
|00002010| 69 66 66 65 72 65 6e 63 | 65 20 62 65 74 77 65 65 |ifferenc|e betwee|
|00002020| 6e 20 61 20 6f 66 66 2d | 73 63 72 65 65 6e 20 6f |n a off-|screen o|
|00002030| 62 6a 65 63 74 20 61 6e | 64 20 61 6e 20 6f 62 6a |bject an|d an obj|
|00002040| 65 63 74 20 74 68 61 74 | 20 77 69 6c 6c 20 62 65 |ect that| will be|
|00002050| 20 64 69 73 70 6c 61 79 | 65 64 20 6f 6e 20 74 68 | display|ed on th|
|00002060| 65 20 73 63 72 65 65 6e | 2e 20 20 57 68 65 6e 20 |e screen|. When |
|00002070| 77 65 20 63 72 65 61 74 | 65 20 61 20 6e 65 77 20 |we creat|e a new |
|00002080| 73 75 62 63 6c 61 73 73 | 20 6f 66 20 56 69 65 77 |subclass| of View|
|00002090| 2c 20 77 65 20 6f 66 74 | 65 6e 20 77 61 6e 74 20 |, we oft|en want |
|000020a0| 74 6f 20 74 65 6c 6c 20 | 74 68 65 20 6f 62 6a 65 |to tell |the obje|
|000020b0| 63 74 20 77 68 65 72 65 | 20 69 74 20 73 68 6f 75 |ct where| it shou|
|000020c0| 6c 64 20 61 70 70 65 61 | 72 20 6f 6e 20 74 68 65 |ld appea|r on the|
|000020d0| 20 73 63 72 65 65 6e 2e | 20 20 54 68 61 74 20 69 | screen.| That i|
|000020e0| 73 20 77 68 79 20 61 6c | 6c 20 73 75 62 63 6c 61 |s why al|l subcla|
|000020f0| 73 73 65 73 20 6f 66 20 | 56 69 65 77 20 61 70 70 |sses of |View app|
|00002100| 65 61 72 20 69 6e 20 61 | 20 70 61 6c 65 74 74 65 |ear in a| palette|
|00002110| 20 61 6e 64 20 6d 61 6e | 79 20 6f 62 6a 65 63 74 | and man|y object|
|00002120| 73 20 74 68 61 74 20 61 | 72 65 20 6e 6f 74 20 73 |s that a|re not s|
|00002130| 75 62 63 6c 61 73 73 65 | 73 20 6f 66 20 56 69 65 |ubclasse|s of Vie|
|00002140| 77 20 61 70 70 65 61 72 | 20 61 73 20 61 20 67 65 |w appear| as a ge|
|00002150| 6e 65 72 69 63 20 6f 62 | 6a 65 63 74 20 69 6e 20 |neric ob|ject in |
|00002160| 74 68 65 20 6c 6f 77 65 | 72 20 6c 65 66 74 20 63 |the lowe|r left c|
|00002170| 6f 72 6e 65 72 20 6f 66 | 20 49 6e 74 65 72 66 61 |orner of| Interfa|
|00002180| 63 65 20 42 75 69 6c 64 | 65 72 20 77 68 65 6e 20 |ce Build|er when |
|00002190| 77 65 20 69 6e 73 74 61 | 6e 74 69 61 74 65 20 74 |we insta|ntiate t|
|000021a0| 68 65 6d 2e 20 20 54 68 | 65 20 ff 00 15 0a 01 f7 |hem. Th|e ......|
|000021b0| 6e 65 77 46 72 61 6d 65 | ff 00 15 0a 00 f7 3a 20 |newFrame|......: |
|000021c0| 6d 65 74 68 6f 64 20 69 | 73 20 73 69 6d 69 6c 61 |method i|s simila|
|000021d0| 72 20 74 6f 20 74 68 65 | 20 ff 00 15 0a 01 f7 6e |r to the| ......n|
|000021e0| 65 77 ff 00 15 0a 00 f7 | 20 6d 65 74 68 6f 64 20 |ew......| method |
|000021f0| 65 78 63 65 70 74 20 74 | 68 61 74 20 69 74 20 6c |except t|hat it l|
|00002200| 65 74 73 20 79 6f 75 20 | 73 70 65 63 69 66 79 20 |ets you |specify |
|00002210| 74 68 65 20 73 69 7a 65 | 20 61 6e 64 20 6c 6f 63 |the size| and loc|
|00002220| 61 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 76 69 65 |ation of| the vie|
|00002230| 77 20 77 68 65 6e 20 69 | 74 20 69 73 20 63 72 65 |w when i|t is cre|
|00002240| 61 74 65 64 2e 20 20 53 | 6f 20 69 6e 73 74 65 61 |ated. S|o instea|
|00002250| 64 20 6f 66 20 75 73 69 | 6e 67 20 74 68 65 20 6e |d of usi|ng the n|
|00002260| 65 77 20 6d 65 74 68 6f | 64 20 66 6f 72 20 69 6e |ew metho|d for in|
|00002270| 69 74 69 61 6c 69 7a 69 | 6e 67 20 69 6e 73 74 61 |itializi|ng insta|
|00002280| 6e 63 65 20 76 61 72 69 | 61 62 6c 65 73 20 69 6e |nce vari|ables in|
|00002290| 20 56 69 65 77 73 20 77 | 65 20 75 73 65 20 74 68 | Views w|e use th|
|000022a0| 65 20 6e 65 77 46 72 61 | 6d 65 3a 3a 20 6d 65 74 |e newFra|me:: met|
|000022b0| 68 6f 64 2e 20 20 46 6f | 72 20 65 78 61 6d 70 6c |hod. Fo|r exampl|
|000022c0| 65 2c 20 73 75 70 70 6f | 73 65 20 74 68 61 74 20 |e, suppo|se that |
|000022d0| 77 65 20 68 61 64 20 61 | 20 47 61 75 67 65 20 6f |we had a| Gauge o|
|000022e0| 62 6a 65 63 74 2e 20 20 | 54 6f 20 63 72 65 61 74 |bject. |To creat|
|000022f0| 65 20 61 20 6e 65 77 20 | 47 61 75 67 65 20 6f 62 |e a new |Gauge ob|
|00002300| 6a 65 63 74 20 77 69 74 | 68 69 6e 20 6f 75 72 20 |ject wit|hin our |
|00002310| 70 72 6f 67 72 61 6d 20 | 77 65 20 77 6f 75 6c 64 |program |we would|
|00002320| 20 61 64 64 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 | add the| followi|
|00002330| 6e 67 20 6c 69 6e 65 73 | 3a 0d 03 55 0d fc 00 90 |ng lines|:..U....|
|00002340| 02 0a 00 90 00 0e 03 0c | 06 30 f7 ff 00 16 0a 00 |........|.0......|
|00002350| f7 0d 0d 0d 69 64 20 6d | 79 47 61 75 67 65 3b 0d |....id m|yGauge;.|
|00002360| 4e 58 52 65 63 74 09 61 | 52 65 63 74 3b 20 20 2f |NXRect.a|Rect; /|
|00002370| 2f 20 63 68 65 63 6b 20 | 74 68 69 73 0d 0d 61 52 |/ check |this..aR|
|00002380| 65 63 74 2e 6f 72 69 67 | 69 6e 2e 78 20 3d 20 31 |ect.orig|in.x = 1|
|00002390| 30 30 2e 30 3b 0d 61 52 | 65 63 74 2e 6f 72 69 67 |00.0;.aR|ect.orig|
|000023a0| 69 6e 2e 79 20 3d 20 32 | 30 30 2e 30 3b 0d 61 52 |in.y = 2|00.0;.aR|
|000023b0| 65 63 74 2e 73 69 7a 65 | 2e 68 65 69 67 68 74 20 |ect.size|.height |
|000023c0| 3d 20 33 30 30 2e 30 3b | 0d 61 52 65 63 74 2e 73 |= 300.0;|.aRect.s|
|000023d0| 69 7a 65 2e 77 69 64 74 | 68 20 3d 20 34 30 30 2e |ize.widt|h = 400.|
|000023e0| 30 3b 0d 6d 79 47 61 75 | 67 65 20 3d 20 5b 47 61 |0;.myGau|ge = [Ga|
|000023f0| 75 67 65 20 6e 65 77 46 | 72 61 6d 65 3a 26 61 52 |uge newF|rame:&aR|
|00002400| 65 63 74 5d 3b 0d ff 00 | 15 0a 00 f7 fc 00 6c 02 |ect];...|......l.|
|00002410| 0a 00 6c 00 0e 02 44 06 | 30 f7 0d 54 68 69 73 20 |..l...D.|0..This |
|00002420| 77 6f 75 6c 64 20 63 72 | 65 61 74 65 20 61 6e 20 |would cr|eate an |
|00002430| 6e 65 77 20 47 61 75 67 | 65 20 77 69 74 68 20 69 |new Gaug|e with i|
|00002440| 74 73 20 6f 72 69 67 69 | 6e 20 61 74 20 74 68 65 |ts origi|n at the|
|00002450| 20 70 6f 69 6e 74 20 28 | 31 30 30 2e 30 2c 20 32 | point (|100.0, 2|
|00002460| 30 30 2e 30 29 20 74 68 | 61 74 20 69 73 20 34 30 |00.0) th|at is 40|
|00002470| 30 20 75 6e 69 74 73 20 | 77 69 64 65 20 61 6e 64 |0 units |wide and|
|00002480| 20 33 30 30 20 75 6e 69 | 74 73 20 68 69 67 68 2e | 300 uni|ts high.|
|00002490| 20 20 54 68 65 20 73 74 | 72 75 63 74 75 72 65 20 | The st|ructure |
|000024a0| 61 52 65 63 74 20 69 73 | 20 61 20 43 20 73 74 72 |aRect is| a C str|
|000024b0| 75 63 74 75 72 65 20 66 | 6f 72 20 67 72 6f 75 70 |ucture f|or group|
|000024c0| 69 6e 67 20 61 6c 6c 20 | 74 68 65 20 69 6e 66 6f |ing all |the info|
|000024d0| 72 6d 61 74 69 6f 6e 20 | 61 73 73 6f 63 69 61 74 |rmation |associat|
|000024e0| 65 64 20 77 69 74 68 20 | 61 20 72 65 63 74 61 6e |ed with |a rectan|
|000024f0| 67 6c 65 2e 0d 0d 54 68 | 65 20 61 72 67 75 6d 65 |gle...Th|e argume|
|00002500| 6e 74 20 74 6f 20 6e 65 | 77 46 72 61 6d 65 20 69 |nt to ne|wFrame i|
|00002510| 73 20 61 20 4e 58 52 65 | 63 74 20 64 61 74 61 20 |s a NXRe|ct data |
|00002520| 73 74 72 75 63 74 75 72 | 65 20 77 68 69 63 68 20 |structur|e which |
|00002530| 69 6e 63 6c 75 64 65 73 | 20 74 68 65 20 68 65 69 |includes| the hei|
|00002540| 67 68 74 20 61 6e 64 20 | 77 69 64 74 68 20 6f 66 |ght and |width of|
|00002550| 20 74 68 65 20 6f 62 6a | 65 63 74 20 61 73 20 77 | the obj|ect as w|
|00002560| 65 6c 6c 20 61 73 20 74 | 68 65 20 69 6e 69 74 69 |ell as t|he initi|
|00002570| 61 6c 20 6f 72 69 67 69 | 6e 20 6f 66 20 74 68 65 |al origi|n of the|
|00002580| 20 6f 62 6a 65 63 74 2e | 20 20 53 65 65 20 43 68 | object.| See Ch|
|00002590| 61 70 74 65 72 20 34 2d | 31 35 20 6f 66 20 74 68 |apter 4-|15 of th|
|000025a0| 65 20 4e 65 58 54 20 73 | 79 73 74 65 6d 20 6d 61 |e NeXT s|ystem ma|
|000025b0| 6e 75 61 6c 20 66 6f 72 | 20 61 20 63 6f 6d 70 6c |nual for| a compl|
|000025c0| 65 74 65 20 64 65 73 63 | 72 69 70 74 69 6f 6e 20 |ete desc|ription |
|000025d0| 6f 66 20 74 68 65 20 4e | 58 52 65 63 74 20 64 61 |of the N|XRect da|
|000025e0| 74 61 20 73 74 72 75 63 | 74 75 72 65 2e 0d fc 00 |ta struc|ture....|
|000025f0| 6c 02 0a 00 6c 00 0e 02 | 44 06 30 f7 f9 00 f7 0d |l...l...|D.0.....|
|00002600| 53 6f 20 69 66 20 77 65 | 20 6e 65 65 64 20 74 6f |So if we| need to|
|00002610| 20 69 6e 69 74 69 61 6c | 69 7a 65 20 73 6f 6d 65 | initial|ize some|
|00002620| 20 76 61 72 69 61 62 6c | 65 73 20 74 68 61 74 20 | variabl|es that |
|00002630| 77 69 6c 6c 20 62 65 20 | 75 73 65 64 20 74 6f 20 |will be |used to |
|00002640| 64 72 61 77 20 6f 75 72 | 20 6f 62 6a 65 63 74 73 |draw our| objects|
|00002650| 20 77 65 20 61 64 64 20 | 74 68 65 20 66 6f 6c 6c | we add |the foll|
|00002660| 6f 77 69 6e 67 20 63 6f | 64 65 20 74 6f 20 74 68 |owing co|de to th|
|00002670| 65 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |e implem|entation|
|00002680| 20 66 69 6c 65 20 28 2e | 6d 20 66 69 6c 65 29 3a | file (.|m file):|
|00002690| 0d 02 0f 0d fc 00 90 02 | 0a 00 90 00 0e 02 d0 06 |........|........|
|000026a0| 30 f7 ff 00 16 0a 00 f7 | 2b 6e 65 77 46 72 61 6d |0.......|+newFram|
|000026b0| 65 3a 28 63 6f 6e 73 74 | 20 4e 58 52 65 63 74 20 |e:(const| NXRect |
|000026c0| 2a 29 74 46 20 7b 0d 09 | 73 65 6c 66 20 3d 20 5b |*)tF {..|self = [|
|000026d0| 73 75 70 65 72 20 6e 65 | 77 46 72 61 6d 65 3a 74 |super ne|wFrame:t|
|000026e0| 46 5d 3b 0d 09 2f 2f 20 | 61 64 64 20 69 6e 69 74 |F];..// |add init|
|000026f0| 69 61 6c 69 7a 61 74 69 | 6f 6e 20 63 6f 64 65 20 |ializati|on code |
|00002700| 68 65 72 65 0d 09 72 65 | 74 75 72 6e 20 73 65 6c |here..re|turn sel|
|00002710| 66 3b 0d 7d 0d 0d fc 00 | 6c 02 0a 00 6c 00 0e 02 |f;.}....|l...l...|
|00002720| d0 06 30 f7 ff 00 15 0a | 00 f7 57 65 20 63 61 6e |..0.....|..We can|
|00002730| 20 6e 6f 77 20 75 6e 64 | 65 72 73 74 61 6e 64 20 | now und|erstand |
|00002740| 61 6e 20 65 78 61 6d 70 | 6c 65 20 70 72 6f 67 72 |an examp|le progr|
|00002750| 61 6d 20 74 68 61 74 20 | 77 69 6c 6c 20 75 73 65 |am that |will use|
|00002760| 20 74 68 69 73 20 74 6f | 20 69 6e 69 74 69 61 6c | this to| initial|
|00002770| 69 7a 65 20 74 68 65 20 | 69 6e 74 65 72 6e 61 6c |ize the |internal|
|00002780| 20 73 74 61 74 65 20 6f | 66 20 61 20 6f 62 6a 65 | state o|f a obje|
|00002790| 63 74 2e 20 20 54 68 65 | 20 22 64 72 61 77 4c 69 |ct. The| "drawLi|
|000027a0| 6e 65 22 20 65 78 61 6d | 70 6c 65 20 69 6e 20 74 |ne" exam|ple in t|
|000027b0| 68 65 20 43 6f 6f 6b 62 | 6f 6f 6b 20 69 73 20 61 |he Cookb|ook is a|
|000027c0| 20 67 6f 6f 64 20 65 78 | 61 6d 70 6c 65 20 6f 66 | good ex|ample of|
|000027d0| 20 74 68 69 73 2e 20 20 | 49 6e 20 74 68 69 73 20 | this. |In this |
|000027e0| 65 78 61 6d 70 6c 65 20 | 77 65 20 74 61 6b 65 20 |example |we take |
|000027f0| 74 68 65 20 73 61 6d 65 | 20 70 72 6f 67 72 61 6d |the same| program|
|00002800| 20 66 72 6f 6d 20 74 68 | 65 20 6c 61 73 74 20 73 | from th|e last s|
|00002810| 65 63 74 69 6f 6e 20 75 | 73 65 64 20 74 6f 20 64 |ection u|sed to d|
|00002820| 72 61 77 20 61 20 6c 69 | 6e 65 20 61 6e 64 20 61 |raw a li|ne and a|
|00002830| 64 64 20 74 65 6e 20 73 | 6c 69 64 65 72 73 20 74 |dd ten s|liders t|
|00002840| 6f 20 63 6f 6e 74 72 6f | 6c 20 68 6f 77 20 74 68 |o contro|l how th|
|00002850| 65 20 6c 69 6e 65 20 69 | 73 20 64 72 61 77 6e 2e |e line i|s drawn.|
|00002860| 20 20 54 68 65 20 6e 65 | 77 46 72 61 6d 65 3a 20 | The ne|wFrame: |
|00002870| 6d 65 74 68 6f 64 20 66 | 6f 72 20 74 68 69 73 20 |method f|or this |
|00002880| 65 78 61 6d 70 6c 65 20 | 6c 6f 6f 6b 73 20 6c 69 |example |looks li|
|00002890| 6b 65 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |ke the f|ollowing|
|000028a0| 3a 0d 06 0b ff 00 16 0a | 00 f7 fc 00 90 02 0a 00 |:.......|........|
|000028b0| 90 00 0e 02 d0 06 30 f7 | 0d fc 00 48 02 0a 00 48 |......0.|...H...H|
|000028c0| 00 0e 02 44 06 30 f7 ff | 00 15 18 01 f7 57 72 61 |...D.0..|.....Wra|
|000028d0| 70 70 69 6e 67 20 50 6f | 73 74 53 63 72 69 70 74 |pping Po|stScript|
|000028e0| 20 46 69 6c 65 73 ff 00 | 15 18 01 f7 0d fc 00 90 | Files..|........|
|000028f0| 02 0a 00 90 00 0e 02 d0 | 06 30 f7 ff 00 16 0a 00 |........|.0......|
|00002900| f7 0d fc 00 6c 02 0a 00 | 6c 00 0e 02 44 06 30 f7 |....l...|l...D.0.|
|00002910| ff 00 15 0a 00 f7 49 66 | 20 79 6f 75 20 68 61 76 |......If| you hav|
|00002920| 65 20 65 76 65 72 20 74 | 61 6b 65 6e 20 61 20 6c |e ever t|aken a l|
|00002930| 6f 6f 6b 20 61 74 20 61 | 20 66 69 6c 65 20 74 68 |ook at a| file th|
|00002940| 61 74 20 77 61 73 20 73 | 65 6e 74 20 74 6f 20 61 |at was s|ent to a|
|00002950| 20 50 6f 73 74 53 63 72 | 69 70 74 20 70 72 69 6e | PostScr|ipt prin|
|00002960| 74 65 72 2c 20 79 6f 75 | 20 77 69 6c 6c 20 66 69 |ter, you| will fi|
|00002970| 6e 64 20 69 74 20 64 6f | 65 73 20 6e 6f 74 20 6c |nd it do|es not l|
|00002980| 6f 6f 6b 20 6c 69 6e 65 | 20 74 68 65 20 64 72 61 |ook line| the dra|
|00002990| 77 69 6e 67 20 63 6f 6d | 6d 61 6e 64 73 20 77 65 |wing com|mands we|
|000029a0| 20 68 61 76 65 20 75 73 | 65 64 20 69 6e 20 74 68 | have us|ed in th|
|000029b0| 65 20 6c 61 73 74 20 63 | 68 61 70 74 65 72 2e 20 |e last c|hapter. |
|000029c0| 20 54 68 69 73 20 69 73 | 20 62 65 63 61 75 73 65 | This is| because|
|000029d0| 20 77 65 20 61 72 65 20 | 72 65 61 6c 6c 79 20 75 | we are |really u|
|000029e0| 73 69 6e 67 20 61 20 43 | 20 6c 69 62 72 61 72 79 |sing a C| library|
|000029f0| 20 74 6f 20 73 65 6e 64 | 20 50 6f 73 74 53 63 72 | to send| PostScr|
|00002a00| 69 70 74 20 63 6f 6d 6d | 61 6e 64 73 20 74 6f 20 |ipt comm|ands to |
|00002a10| 74 68 65 20 4e 65 58 54 | 73 74 65 70 20 50 6f 73 |the NeXT|step Pos|
|00002a20| 74 53 63 72 69 70 74 20 | 64 69 73 70 6c 61 79 20 |tScript |display |
|00002a30| 73 65 72 76 65 72 2e 20 | 20 54 68 69 73 20 69 73 |server. | This is|
|00002a40| 20 61 6e 20 65 61 73 79 | 20 77 61 79 20 74 6f 20 | an easy| way to |
|00002a50| 69 6e 74 72 6f 64 75 63 | 65 20 50 6f 73 74 53 63 |introduc|e PostSc|
|00002a60| 72 69 70 74 20 64 72 61 | 77 69 6e 67 20 74 6f 20 |ript dra|wing to |
|00002a70| 62 65 67 69 6e 6e 65 72 | 73 20 61 6c 72 65 61 64 |beginner|s alread|
|00002a80| 79 20 66 61 6d 69 6c 69 | 61 72 20 77 69 74 68 20 |y famili|ar with |
|00002a90| 74 68 65 20 43 20 6c 61 | 6e 67 75 61 67 65 2e 20 |the C la|nguage. |
|00002aa0| 20 54 68 65 20 72 65 61 | 6c 20 50 6f 73 74 53 63 | The rea|l PostSc|
|00002ab0| 72 69 70 74 20 6c 61 6e | 67 75 61 67 65 20 69 73 |ript lan|guage is|
|00002ac0| 20 73 6c 69 67 68 74 6c | 79 20 64 69 66 66 65 72 | slightl|y differ|
|00002ad0| 65 6e 74 2e 20 20 54 68 | 65 20 63 6f 6d 6d 61 6e |ent. Th|e comman|
|00002ae0| 64 73 20 61 72 65 20 74 | 68 65 20 73 61 6d 65 2c |ds are t|he same,|
|00002af0| 20 62 75 74 20 69 6e 73 | 74 65 61 64 20 6f 66 20 | but ins|tead of |
|00002b00| 70 75 74 74 69 6e 67 20 | 74 68 65 20 61 72 67 75 |putting |the argu|
|00002b10| 6d 65 6e 74 73 20 61 66 | 74 65 72 20 74 68 65 20 |ments af|ter the |
|00002b20| 63 6f 6d 6d 61 6e 64 2c | 20 50 6f 73 74 53 63 72 |command,| PostScr|
|00002b30| 69 70 74 20 70 75 74 73 | 20 74 68 65 20 61 72 67 |ipt puts| the arg|
|00002b40| 75 6d 65 6e 74 73 20 62 | 65 66 6f 72 65 20 74 68 |uments b|efore th|
|00002b50| 65 20 63 6f 6d 6d 61 6e | 64 2e 20 20 54 68 69 73 |e comman|d. This|
|00002b60| 20 69 73 20 63 61 6c 6c | 65 64 20 70 72 65 2d 66 | is call|ed pre-f|
|00002b70| 69 78 20 6c 61 6e 67 75 | 61 67 65 2e 20 20 4f 74 |ix langu|age. Ot|
|00002b80| 68 65 72 20 65 78 61 6d | 70 6c 65 73 20 6f 66 20 |her exam|ples of |
|00002b90| 70 72 65 66 69 78 20 63 | 6f 6d 6d 61 6e 64 20 73 |prefix c|ommand s|
|00002ba0| 74 72 75 63 74 75 72 65 | 73 20 61 72 65 20 48 2d |tructure|s are H-|
|00002bb0| 50 20 63 61 6c 63 75 6c | 61 74 6f 72 73 20 61 6e |P calcul|ators an|
|00002bc0| 64 20 74 68 65 20 46 6f | 75 72 74 68 20 6c 61 6e |d the Fo|urth lan|
|00002bd0| 67 75 61 67 65 2e 20 20 | 54 68 65 20 72 65 61 73 |guage. |The reas|
|00002be0| 6f 6e 20 66 6f 72 20 74 | 68 69 73 20 69 73 20 74 |on for t|his is t|
|00002bf0| 68 61 74 20 61 72 67 75 | 6d 65 6e 74 20 70 61 73 |hat argu|ment pas|
|00002c00| 73 69 6e 67 20 63 61 6e | 20 62 65 20 64 6f 6e 65 |sing can| be done|
|00002c10| 20 6f 6e 20 61 20 62 75 | 69 6c 74 20 69 6e 20 73 | on a bu|ilt in s|
|00002c20| 74 72 75 63 74 75 72 65 | 20 63 61 6c 6c 65 64 20 |tructure| called |
|00002c30| 61 20 73 74 61 63 6b 2e | 20 20 45 61 63 68 20 6c |a stack.| Each l|
|00002c40| 69 6e 65 20 6f 66 20 74 | 68 65 20 70 72 6f 67 72 |ine of t|he progr|
|00002c50| 61 6d 20 63 61 6e 20 61 | 73 73 75 6d 65 20 74 68 |am can a|ssume th|
|00002c60| 61 74 20 61 6c 6c 20 74 | 68 65 20 61 72 67 75 6d |at all t|he argum|
|00002c70| 65 6e 74 73 20 61 72 65 | 20 6f 6e 20 74 68 65 20 |ents are| on the |
|00002c80| 73 74 61 63 6b 20 61 6e | 64 20 77 68 65 6e 20 74 |stack an|d when t|
|00002c90| 68 65 79 20 61 72 65 20 | 64 6f 6e 65 20 74 68 65 |hey are |done the|
|00002ca0| 79 20 6a 75 73 74 20 6c | 65 61 76 65 20 74 68 65 |y just l|eave the|
|00002cb0| 69 72 20 72 65 73 75 6c | 74 73 20 6f 6e 20 74 68 |ir resul|ts on th|
|00002cc0| 65 20 73 74 61 63 6b 2e | 20 20 54 68 69 73 20 73 |e stack.| This s|
|00002cd0| 61 76 65 73 20 61 20 6c | 6f 74 20 6f 66 20 6d 65 |aves a l|ot of me|
|00002ce0| 6d 6f 72 79 20 74 68 61 | 74 20 6d 75 73 74 20 62 |mory tha|t must b|
|00002cf0| 65 20 72 65 73 65 72 76 | 65 64 20 66 6f 72 20 74 |e reserv|ed for t|
|00002d00| 65 6d 70 6f 72 61 72 79 | 20 73 74 6f 72 61 67 65 |emporary| storage|
|00002d10| 20 61 6e 64 20 6d 61 6b | 65 73 20 74 68 65 20 6c | and mak|es the l|
|00002d20| 61 6e 67 75 61 67 65 20 | 6d 75 63 68 20 65 61 73 |anguage |much eas|
|00002d30| 69 65 72 20 74 6f 20 69 | 6d 70 6c 65 6d 65 6e 74 |ier to i|mplement|
|00002d40| 20 61 6e 64 20 6d 75 63 | 68 20 6d 6f 72 65 20 65 | and muc|h more e|
|00002d50| 66 66 69 63 69 65 6e 74 | 2e 20 20 54 68 65 20 6f |fficient|. The o|
|00002d60| 6e 6c 79 20 70 72 6f 62 | 6c 65 6d 20 69 73 20 74 |nly prob|lem is t|
|00002d70| 68 61 74 20 69 66 20 79 | 6f 75 20 61 72 65 20 6e |hat if y|ou are n|
|00002d80| 6f 74 20 66 61 6d 69 6c | 69 61 72 20 77 69 74 68 |ot famil|iar with|
|00002d90| 20 61 20 70 72 65 2d 66 | 69 78 20 6c 61 6e 67 75 | a pre-f|ix langu|
|00002da0| 61 67 65 20 69 74 20 63 | 61 6e 20 62 65 20 76 65 |age it c|an be ve|
|00002db0| 72 79 20 68 61 72 64 20 | 74 6f 20 70 72 6f 67 72 |ry hard |to progr|
|00002dc0| 61 6d 2e 20 20 54 68 65 | 20 22 69 6d 70 6c 69 65 |am. The| "implie|
|00002dd0| 64 20 73 74 61 63 6b 22 | 20 74 61 6b 65 73 20 73 |d stack"| takes s|
|00002de0| 6f 6d 65 20 67 65 74 74 | 69 6e 67 20 75 73 65 64 |ome gett|ing used|
|00002df0| 20 74 6f 2e 20 20 54 68 | 69 73 20 64 69 64 6e 27 | to. Th|is didn'|
|00002e00| 74 20 62 6f 74 68 65 72 | 20 70 65 6f 70 6c 65 20 |t bother| people |
|00002e10| 77 68 6f 20 77 65 72 65 | 20 62 75 69 6c 64 69 6e |who were| buildin|
|00002e20| 67 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 50 |g the or|iginal P|
|00002e30| 6f 73 74 53 63 72 69 70 | 74 20 70 72 69 6e 74 65 |ostScrip|t printe|
|00002e40| 72 73 20 73 69 6e 63 65 | 20 74 68 65 79 20 66 65 |rs since| they fe|
|00002e50| 6c 74 20 74 68 61 74 20 | 6d 6f 73 74 20 50 6f 73 |lt that |most Pos|
|00002e60| 74 53 63 72 69 70 74 20 | 66 69 6c 65 73 20 77 6f |tScript |files wo|
|00002e70| 75 6c 64 20 62 65 20 67 | 65 6e 65 72 61 74 65 64 |uld be g|enerated|
|00002e80| 20 62 79 20 63 6f 6d 70 | 75 74 65 72 73 20 61 6e | by comp|uters an|
|00002e90| 64 20 74 68 65 6e 20 70 | 72 6f 63 65 73 73 65 64 |d then p|rocessed|
|00002ea0| 20 62 79 20 63 6f 6d 70 | 75 74 65 72 73 2e 0d 02 | by comp|uters...|
|00002eb0| b5 fc 00 49 02 0a 00 49 | 00 0e 01 b0 06 30 f7 ff |...I...I|.....0..|
|00002ec0| 00 15 12 01 f7 0d 4c 65 | 61 72 6e 69 6e 67 20 50 |......Le|arning P|
|00002ed0| 6f 73 74 53 63 72 69 70 | 74 3a 20 59 41 50 ff 00 |ostScrip|t: YAP..|
|00002ee0| 15 12 02 f7 0d fc 00 6c | 02 0a 00 6c 00 0e 02 44 |.......l|...l...D|
|00002ef0| 06 30 f7 ff 00 15 0a 00 | f7 0d 54 68 65 20 62 65 |.0......|..The be|
|00002f00| 73 74 20 77 61 79 20 74 | 6f 20 6c 65 61 72 6e 20 |st way t|o learn |
|00002f10| 68 6f 77 20 74 6f 20 70 | 72 6f 67 72 61 6d 20 77 |how to p|rogram w|
|00002f20| 69 74 68 20 70 75 72 65 | 20 50 6f 73 74 53 63 72 |ith pure| PostScr|
|00002f30| 69 70 74 20 69 73 20 74 | 6f 20 73 69 74 20 64 6f |ipt is t|o sit do|
|00002f40| 77 6e 20 61 74 20 61 20 | 4e 65 58 54 20 61 6e 64 |wn at a |NeXT and|
|00002f50| 20 62 72 69 6e 67 20 75 | 70 20 74 68 65 20 59 41 | bring u|p the YA|
|00002f60| 50 20 70 72 6f 67 72 61 | 6d 2e 20 20 59 41 50 20 |P progra|m. YAP |
|00002f70| 73 74 61 6e 64 73 20 66 | 6f 72 20 22 59 65 74 20 |stands f|or "Yet |
|00002f80| 41 6e 6f 74 68 65 72 20 | 50 72 65 76 69 65 77 65 |Another |Previewe|
|00002f90| 72 22 2c 20 61 20 74 61 | 6b 65 20 6f 66 66 20 6f |r", a ta|ke off o|
|00002fa0| 6e 20 74 68 65 20 66 61 | 63 74 20 74 68 61 74 20 |n the fa|ct that |
|00002fb0| 74 68 65 72 65 20 69 73 | 20 61 20 70 72 6f 67 72 |there is| a progr|
|00002fc0| 61 6d 20 63 61 6c 6c 65 | 64 20 59 41 43 43 20 28 |am calle|d YACC (|
|00002fd0| 59 65 74 20 41 6e 6f 74 | 68 65 72 20 43 6f 6d 70 |Yet Anot|her Comp|
|00002fe0| 69 6c 65 72 20 43 6f 6d | 70 69 6c 65 72 29 20 61 |iler Com|piler) a|
|00002ff0| 6e 64 20 74 68 61 74 20 | 74 68 65 72 65 20 69 73 |nd that |there is|
|00003000| 20 61 6c 72 65 61 64 79 | 20 61 20 50 72 65 76 69 | already| a Previ|
|00003010| 65 77 20 70 72 6f 67 72 | 61 6d 20 74 68 61 74 20 |ew progr|am that |
|00003020| 69 73 20 75 73 65 64 20 | 77 69 74 68 20 74 68 65 |is used |with the|
|00003030| 20 4e 65 58 54 20 73 79 | 73 74 65 6d 2e 20 20 59 | NeXT sy|stem. Y|
|00003040| 41 50 20 69 73 20 75 73 | 65 66 75 6c 20 62 65 63 |AP is us|eful bec|
|00003050| 61 75 73 65 20 69 74 20 | 63 6f 6d 62 69 6e 65 73 |ause it |combines|
|00003060| 20 74 68 65 20 65 64 69 | 74 69 6e 67 20 66 65 61 | the edi|ting fea|
|00003070| 74 75 72 65 73 20 77 69 | 74 68 20 61 20 70 72 65 |tures wi|th a pre|
|00003080| 76 69 65 77 20 61 72 65 | 61 20 73 6f 20 74 68 61 |view are|a so tha|
|00003090| 74 20 77 65 20 63 61 6e | 20 73 65 65 20 50 6f 73 |t we can| see Pos|
|000030a0| 74 53 63 72 69 70 74 20 | 70 72 6f 67 72 61 6d 73 |tScript |programs|
|000030b0| 20 62 65 69 6e 67 20 63 | 72 65 61 74 65 64 2e 20 | being c|reated. |
|000030c0| 20 59 41 50 20 69 73 20 | 6c 6f 63 61 74 65 64 20 | YAP is |located |
|000030d0| 69 6e 20 2f 4e 65 78 74 | 44 65 76 65 6c 6f 70 65 |in /Next|Develope|
|000030e0| 72 2f 44 65 6d 6f 73 2e | 20 20 54 6f 20 75 73 65 |r/Demos.| To use|
|000030f0| 20 69 74 20 73 74 61 72 | 74 20 69 74 20 75 70 20 | it star|t it up |
|00003100| 61 6e 64 20 75 73 65 20 | 74 68 65 20 63 6f 6d 6d |and use |the comm|
|00003110| 61 6e 64 20 74 6f 20 6f | 70 65 6e 20 74 68 65 20 |and to o|pen the |
|00003120| 50 6f 73 74 53 63 72 69 | 70 74 20 65 78 61 6d 70 |PostScri|pt examp|
|00003130| 6c 65 20 66 69 6c 65 73 | 20 6f 72 20 75 73 65 20 |le files| or use |
|00003140| 74 68 65 20 4e 65 77 20 | 63 6f 6d 6d 61 6e 64 20 |the New |command |
|00003150| 74 6f 20 63 72 65 61 74 | 65 20 79 6f 75 72 20 6f |to creat|e your o|
|00003160| 77 6e 2e 0d 0d 0d 03 69 | 48 65 72 65 20 61 72 65 |wn.....i|Here are|
|00003170| 20 73 6f 6d 65 20 73 61 | 6d 70 6c 65 73 20 74 6f | some sa|mples to|
|00003180| 20 74 72 79 3a 0d 0d 44 | 72 61 77 20 61 20 73 69 | try:..D|raw a si|
|00003190| 6d 70 6c 65 20 6c 69 6e | 65 3a 0d ff 00 15 0a 00 |mple lin|e:......|
|000031a0| f7 0d fc 00 90 02 0a 00 | 90 00 0e 02 d4 06 30 f7 |........|......0.|
|000031b0| ff 00 16 0a 00 f7 25 21 | 0d 6e 65 77 70 61 74 68 |......%!|.newpath|
|000031c0| 0d 20 20 20 31 30 30 20 | 35 30 20 6d 6f 76 65 74 |. 100 |50 movet|
|000031d0| 6f 0d 20 20 20 33 30 30 | 20 32 30 30 20 6c 69 6e |o. 300| 200 lin|
|000031e0| 65 74 6f 0d 73 74 72 6f | 6b 65 0d 73 68 6f 77 70 |eto.stro|ke.showp|
|000031f0| 61 67 65 0d fc 00 6c 02 | 0a 00 6c 00 0e 02 44 06 |age...l.|..l...D.|
|00003200| 30 f7 ff 00 15 0a 00 f7 | 0d 44 72 61 77 20 61 20 |0.......|.Draw a |
|00003210| 63 69 72 63 6c 65 20 77 | 69 74 68 20 61 20 6c 69 |circle w|ith a li|
|00003220| 67 68 74 20 67 72 61 79 | 20 73 68 61 64 65 20 6f |ght gray| shade o|
|00003230| 66 20 67 72 61 79 3a 0d | 0d fc 00 90 02 0a 00 90 |f gray:.|........|
|00003240| 00 0e 02 d4 06 30 f7 ff | 00 16 0a 00 f7 25 21 0d |.....0..|.....%!.|
|00003250| 2e 33 33 33 20 73 65 74 | 67 72 61 79 0d 6e 65 77 |.333 set|gray.new|
|00003260| 70 61 74 68 0d 20 20 20 | 32 30 30 20 31 30 30 20 |path. |200 100 |
|00003270| 35 30 20 30 20 33 36 30 | 20 61 72 63 0d 20 66 69 |50 0 360| arc. fi|
|00003280| 6c 6c 0d 73 68 6f 77 70 | 61 67 65 0d fc 00 6c 02 |ll.showp|age...l.|
|00003290| 0a 00 6c 00 0e 02 44 06 | 30 f7 ff 00 15 0a 00 f7 |..l...D.|0.......|
|000032a0| 0d 44 72 61 77 20 61 20 | 63 75 72 76 65 20 35 20 |.Draw a |curve 5 |
|000032b0| 75 6e 69 74 73 20 77 69 | 64 65 20 74 6f 20 66 69 |units wi|de to fi|
|000032c0| 74 20 74 68 72 65 65 20 | 70 6f 69 6e 74 73 3a ff |t three |points:.|
|000032d0| 00 16 0a 00 f7 0d fc 00 | 90 02 0a 00 90 00 0e 02 |........|........|
|000032e0| d4 06 30 f7 0d 25 21 0d | 35 20 73 65 74 6c 69 6e |..0..%!.|5 setlin|
|000032f0| 65 77 69 64 74 68 0d 6e | 65 77 70 61 74 68 0d 20 |ewidth.n|ewpath. |
|00003300| 20 20 31 30 30 20 31 30 | 30 20 6d 6f 76 65 74 6f | 100 10|0 moveto|
|00003310| 0d 20 20 20 31 30 30 20 | 31 30 30 20 20 20 31 35 |. 100 |100 15|
|00003320| 30 20 34 30 30 20 20 20 | 33 30 30 20 31 30 30 20 |0 400 |300 100 |
|00003330| 63 75 72 76 65 74 6f 0d | 73 74 72 6f 6b 65 0d 73 |curveto.|stroke.s|
|00003340| 68 6f 77 70 61 67 65 0d | 0d fc 00 6c 02 0a 00 6c |howpage.|...l...l|
|00003350| 00 0e 02 44 06 30 f7 ff | 00 15 0a 00 f7 54 72 79 |...D.0..|.....Try|
|00003360| 20 63 68 61 6e 67 69 6e | 67 20 6f 6e 65 20 6f 72 | changin|g one or|
|00003370| 20 74 77 6f 20 6e 75 6d | 62 65 72 73 20 61 6e 64 | two num|bers and|
|00003380| 20 74 68 65 6e 20 65 78 | 65 63 75 74 69 6e 67 20 | then ex|ecuting |
|00003390| 74 68 65 20 63 6f 6d 6d | 61 6e 64 2d 45 20 6b 65 |the comm|and-E ke|
|000033a0| 79 2e 20 20 54 68 69 73 | 20 77 69 6c 6c 20 65 72 |y. This| will er|
|000033b0| 61 73 65 20 74 68 65 20 | 73 63 72 65 65 6e 20 61 |ase the |screen a|
|000033c0| 6e 64 20 72 65 64 72 61 | 77 20 74 68 65 20 64 69 |nd redra|w the di|
|000033d0| 73 70 6c 61 79 20 61 72 | 65 61 20 75 73 69 6e 67 |splay ar|ea using|
|000033e0| 20 79 6f 75 72 20 63 68 | 61 6e 67 65 73 2e 20 20 | your ch|anges. |
|000033f0| 54 68 69 73 20 67 69 76 | 65 73 20 79 6f 75 20 61 |This giv|es you a|
|00003400| 6c 6d 6f 73 74 20 69 6e | 73 74 61 6e 74 61 6e 65 |lmost in|stantane|
|00003410| 6f 75 73 20 66 65 65 64 | 62 61 63 6b 20 6f 6e 20 |ous feed|back on |
|00003420| 79 6f 75 72 20 64 72 61 | 77 69 6e 67 20 63 6f 6d |your dra|wing com|
|00003430| 6d 61 6e 64 73 2e 20 20 | 49 74 20 61 6c 6c 6f 77 |mands. |It allow|
|00003440| 73 20 79 6f 75 20 74 6f | 20 65 78 70 65 72 69 6d |s you to| experim|
|00003450| 65 6e 74 20 61 6e 64 20 | 71 75 69 63 6b 6c 79 20 |ent and |quickly |
|00003460| 6c 65 61 72 6e 20 74 68 | 65 20 50 6f 73 74 53 63 |learn th|e PostSc|
|00003470| 72 69 70 74 20 6c 61 6e | 67 75 61 67 65 20 61 6e |ript lan|guage an|
|00003480| 64 20 69 74 73 20 70 6f | 77 65 72 66 75 6c 20 66 |d its po|werful f|
|00003490| 65 61 74 75 72 65 73 2e | ff 00 16 0a 00 f7 0d 0d |eatures.|........|
|000034a0| fc 00 49 02 0a 00 49 00 | 0e 01 b0 06 30 f7 ff 00 |..I...I.|....0...|
|000034b0| 15 12 01 f7 43 72 65 61 | 74 69 6e 67 20 61 20 50 |....Crea|ting a P|
|000034c0| 53 77 72 61 70 20 66 69 | 6c 65 ff 00 15 12 02 f7 |Swrap fi|le......|
|000034d0| 0d 03 2f fc 00 6c 02 0a | 00 6c 00 0e 02 44 06 30 |../..l..|.l...D.0|
|000034e0| f7 ff 00 15 0a 00 f7 0d | 41 66 74 65 72 20 79 6f |........|After yo|
|000034f0| 75 20 68 61 76 65 20 63 | 72 65 61 74 65 64 20 73 |u have c|reated s|
|00003500| 6f 6d 65 20 63 6f 6d 70 | 6c 65 78 20 50 6f 73 74 |ome comp|lex Post|
|00003510| 53 63 72 69 70 74 20 69 | 6d 61 67 65 73 20 79 6f |Script i|mages yo|
|00003520| 75 20 63 61 6e 20 6e 6f | 77 20 69 6e 74 65 67 72 |u can no|w integr|
|00003530| 61 74 65 20 74 68 65 6d | 20 69 6e 74 6f 20 79 6f |ate them| into yo|
|00003540| 75 72 20 70 72 6f 67 72 | 61 6d 73 20 62 79 20 72 |ur progr|ams by r|
|00003550| 75 6e 6e 69 6e 67 20 61 | 20 63 6f 6d 6d 61 6e 64 |unning a| command|
|00003560| 20 63 61 6c 6c 65 64 20 | 22 70 73 77 72 61 70 22 | called |"pswrap"|
|00003570| 2e 20 20 20 53 75 70 70 | 6f 73 65 20 79 6f 75 20 |. Supp|ose you |
|00003580| 6a 75 73 74 20 63 72 65 | 61 74 65 64 20 61 20 70 |just cre|ated a p|
|00003590| 72 6f 67 72 61 6d 20 66 | 6f 72 20 64 72 61 77 69 |rogram f|or drawi|
|000035a0| 6e 67 20 61 20 63 69 72 | 63 6c 65 20 73 75 63 68 |ng a cir|cle such|
|000035b0| 20 61 73 20 69 6e 20 74 | 68 65 20 73 65 63 6f 6e | as in t|he secon|
|000035c0| 64 20 65 78 61 6d 70 6c | 65 20 61 62 6f 76 65 2e |d exampl|e above.|
|000035d0| 20 20 59 6f 75 20 77 6f | 75 6c 64 20 6e 6f 77 20 | You wo|uld now |
|000035e0| 6c 69 6b 65 20 74 6f 20 | 62 65 20 61 62 6c 65 20 |like to |be able |
|000035f0| 74 6f 20 64 72 61 77 20 | 61 20 63 69 72 63 6c 65 |to draw |a circle|
|00003600| 20 66 72 6f 6d 20 77 69 | 74 68 69 6e 20 79 6f 75 | from wi|thin you|
|00003610| 72 20 4f 62 6a 65 63 74 | 69 76 65 20 43 20 70 72 |r Object|ive C pr|
|00003620| 6f 67 72 61 6d 20 62 79 | 20 61 64 64 69 6e 67 20 |ogram by| adding |
|00003630| 74 68 65 20 6c 69 6e 65 | 0d 0d 09 64 72 61 77 43 |the line|...drawC|
|00003640| 69 72 63 6c 65 28 72 61 | 64 69 75 73 2c 20 73 68 |ircle(ra|dius, sh|
|00003650| 61 64 65 29 3b 0d 0d 0d | 0d 54 68 69 73 20 69 73 |ade);...|.This is|
|00003660| 20 64 6f 6e 65 20 62 79 | 20 75 73 69 6e 67 20 62 | done by| using b|
|00003670| 79 20 75 73 69 6e 67 20 | 74 68 65 20 66 6f 6c 6c |y using |the foll|
|00003680| 6f 77 69 6e 67 20 73 74 | 65 70 73 2e 0d 0d 54 68 |owing st|eps...Th|
|00003690| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 70 6f 73 74 |e follow|ing post|
|000036a0| 73 63 72 69 70 74 20 64 | 65 66 69 6e 69 74 69 6f |script d|efinitio|
|000036b0| 6e 20 66 6f 72 20 64 72 | 61 77 43 69 72 63 6c 65 |n for dr|awCircle|
|000036c0| 20 74 61 6b 65 73 20 74 | 68 65 20 72 61 64 69 75 | takes t|he radiu|
|000036d0| 73 20 61 6e 64 20 73 68 | 61 64 65 20 6f 66 20 63 |s and sh|ade of c|
|000036e0| 69 72 63 6c 65 20 66 72 | 6f 6d 20 74 68 65 20 73 |ircle fr|om the s|
|000036f0| 74 61 63 6b 3b 0d 0d fc | 00 90 02 0a 00 90 00 0e |tack;...|........|
|00003700| 02 d4 03 64 06 30 f7 ff | 00 16 0a 01 f7 2f 64 72 |...d.0..|...../dr|
|00003710| 61 77 43 69 72 63 6c 65 | 0d 7b 0d 2f 72 61 64 69 |awCircle|.{./radi|
|00003720| 75 73 20 65 78 63 68 20 | 64 65 66 0d 2f 73 68 61 |us exch |def./sha|
|00003730| 64 65 20 65 78 63 68 20 | 64 65 66 0d ff 00 16 0a |de exch |def.....|
|00003740| 00 f7 67 73 61 76 65 20 | 0d 20 20 09 63 75 72 72 |..gsave |. .curr|
|00003750| 65 6e 74 70 6f 69 6e 74 | 0d 09 6e 65 77 70 61 74 |entpoint|..newpat|
|00003760| 68 0d 09 09 72 61 64 69 | 75 73 20 30 20 33 36 30 |h...radi|us 0 360|
|00003770| 20 61 72 63 0d 09 73 68 | 61 64 65 20 73 65 74 67 | arc..sh|ade setg|
|00003780| 72 61 79 0d 20 09 66 69 | 6c 6c 20 0d 67 72 65 73 |ray. .fi|ll .gres|
|00003790| 74 6f 72 65 0d ff 00 16 | 0a 01 f7 7d 20 64 65 66 |tore....|...} def|
|000037a0| 0d ff 00 16 0a 00 f7 0d | fc 00 6c 02 0a 00 6c 00 |........|..l...l.|
|000037b0| 0e 02 44 06 30 f7 ff 00 | 15 0a 00 f7 57 65 20 77 |..D.0...|....We w|
|000037c0| 6f 75 6c 64 20 72 65 70 | 6c 61 63 65 20 74 68 65 |ould rep|lace the|
|000037d0| 20 6c 69 6e 65 73 20 69 | 6e 20 62 6f 6c 64 20 61 | lines i|n bold a|
|000037e0| 62 6f 76 65 20 62 79 20 | 74 68 65 20 6c 69 6e 65 |bove by |the line|
|000037f0| 73 20 69 6e 20 62 6f 6c | 64 20 62 65 6c 6f 77 2e |s in bol|d below.|
|00003800| 20 0d 04 6b ff 00 15 0a | 01 f7 0d 46 69 67 75 72 | ..k....|...Figur|
|00003810| 65 20 39 2d 32 3a 52 65 | 73 75 6c 74 20 6f 66 20 |e 9-2:Re|sult of |
|00003820| 55 73 69 6e 67 20 50 6f | 73 74 53 63 72 69 70 74 |Using Po|stScript|
|00003830| 20 57 72 61 70 20 46 75 | 6e 63 74 69 6f 6e 73 ff | Wrap Fu|nctions.|
|00003840| 00 15 0a 00 f7 0d 0d fc | 00 6c 02 0a 00 6c 00 0e |........|.l...l..|
|00003850| 02 44 06 30 f7 0d 0d 0d | ff 00 15 12 01 f7 f9 00 |.D.0....|........|
|00003860| f7 45 78 61 6d 70 6c 65 | 20 39 2d 33 3a 20 41 20 |.Example| 9-3: A |
|00003870| 73 69 6d 70 6c 65 20 50 | 69 65 20 43 68 61 72 74 |simple P|ie Chart|
|00003880| 0d 0d ff 00 15 0a 00 f7 | 4f 6e 65 20 6f 66 20 74 |........|One of t|
|00003890| 68 65 20 61 64 76 61 6e | 74 61 67 65 73 20 6f 66 |he advan|tages of|
|000038a0| 20 75 73 69 6e 67 20 50 | 6f 73 74 53 63 72 69 70 | using P|ostScrip|
|000038b0| 74 20 77 72 61 70 73 20 | 69 73 20 74 68 61 74 20 |t wraps |is that |
|000038c0| 74 68 65 72 65 20 69 73 | 20 61 20 6c 61 72 67 65 |there is| a large|
|000038d0| 20 6c 69 62 72 61 72 79 | 20 6f 66 20 50 6f 73 74 | library| of Post|
|000038e0| 53 63 72 69 70 74 20 72 | 6f 75 74 69 6e 65 73 20 |Script r|outines |
|000038f0| 72 65 61 64 69 6c 79 20 | 61 76 61 69 6c 61 62 6c |readily |availabl|
|00003900| 65 20 66 6f 72 20 64 72 | 61 77 69 6e 67 20 73 74 |e for dr|awing st|
|00003910| 61 6e 64 61 72 64 20 6f | 62 6a 65 63 74 73 2e 20 |andard o|bjects. |
|00003920| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 20 69 6e 20 | For exa|mple in |
|00003930| 74 68 65 20 50 6f 73 74 | 53 63 72 69 70 74 20 4c |the Post|Script L|
|00003940| 61 6e 67 75 61 67 65 20 | 54 75 74 6f 72 69 61 6c |anguage |Tutorial|
|00003950| 20 61 6e 64 20 43 6f 6f | 6b 62 6f 6f 6b 20 74 68 | and Coo|kbook th|
|00003960| 65 72 65 20 69 73 20 61 | 6e 20 65 78 61 6d 70 6c |ere is a|n exampl|
|00003970| 65 20 70 72 6f 67 72 61 | 6d 20 74 68 61 74 20 64 |e progra|m that d|
|00003980| 72 61 77 73 20 50 69 65 | 43 68 61 72 74 73 2e 20 |raws Pie|Charts. |
|00003990| 20 4f 6e 65 20 6f 66 20 | 74 68 65 20 66 75 6e 63 | One of |the func|
|000039a0| 74 69 6f 6e 73 20 69 74 | 20 75 73 65 73 20 69 73 |tions it| uses is|
|000039b0| 20 61 20 72 6f 75 74 69 | 6e 65 20 63 61 6c 6c 65 | a routi|ne calle|
|000039c0| 64 20 64 72 61 77 53 6c | 69 63 65 3a 2e 20 20 49 |d drawSl|ice:. I|
|000039d0| 6e 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 65 |n the or|iginal e|
|000039e0| 78 61 6d 70 6c 65 20 74 | 68 65 20 70 72 6f 67 72 |xample t|he progr|
|000039f0| 61 6d 20 74 6f 6f 6b 20 | 74 68 65 20 67 72 61 79 |am took |the gray|
|00003a00| 20 73 68 61 64 65 2c 20 | 74 68 65 20 65 6e 64 69 | shade, |the endi|
|00003a10| 6e 67 20 61 6e 67 6c 65 | 2c 20 74 68 65 20 73 74 |ng angle|, the st|
|00003a20| 61 72 74 69 6e 67 20 61 | 6e 67 6c 65 20 61 6e 64 |arting a|ngle and|
|00003a30| 20 74 68 65 20 6c 61 62 | 65 6c 20 6f 66 66 20 74 | the lab|el off t|
|00003a40| 68 65 20 73 74 61 63 6b | 2e 20 20 49 74 20 61 6c |he stack|. It al|
|00003a50| 73 6f 20 75 73 65 64 20 | 74 68 65 20 72 61 64 69 |so used |the radi|
|00003a60| 75 73 20 77 68 69 63 68 | 20 77 61 73 20 61 6e 20 |us which| was an |
|00003a70| 61 72 67 75 6d 65 6e 74 | 20 74 6f 20 61 6e 6f 74 |argument| to anot|
|00003a80| 68 65 72 20 66 75 6e 63 | 74 69 6f 6e 20 63 61 6c |her func|tion cal|
|00003a90| 6c 65 64 20 44 72 61 77 | 50 69 65 43 68 61 72 74 |led Draw|PieChart|
|00003aa0| 2e 20 20 57 68 61 74 20 | 77 65 20 68 61 76 65 20 |. What |we have |
|00003ab0| 64 6f 6e 65 20 69 73 20 | 6a 75 73 74 20 63 68 61 |done is |just cha|
|00003ac0| 6e 67 65 64 20 74 68 65 | 20 66 69 72 73 74 20 66 |nged the| first f|
|00003ad0| 65 77 20 6c 69 6e 65 73 | 20 61 6e 64 20 74 68 65 |ew lines| and the|
|00003ae0| 20 6c 61 73 74 20 6c 69 | 6e 65 20 61 73 20 69 6e | last li|ne as in|
|00003af0| 20 74 68 65 20 65 78 61 | 6d 70 6c 65 20 61 62 6f | the exa|mple abo|
|00003b00| 76 65 20 66 6f 72 20 74 | 68 65 20 44 72 61 77 43 |ve for t|he DrawC|
|00003b10| 69 72 63 6c 65 20 61 6e | 64 20 63 72 65 61 74 65 |ircle an|d create|
|00003b20| 64 20 72 6f 75 74 69 6e | 65 20 66 6f 72 20 64 72 |d routin|e for dr|
|00003b30| 61 77 69 6e 67 20 61 20 | 73 6c 69 63 65 20 6f 66 |awing a |slice of|
|00003b40| 20 61 20 50 69 65 43 68 | 61 72 74 2e 20 20 54 68 | a PieCh|art. Th|
|00003b50| 65 20 63 6f 6e 74 65 6e | 74 73 20 6f 66 20 74 68 |e conten|ts of th|
|00003b60| 65 20 66 69 6c 65 20 73 | 6c 69 63 65 2e 70 73 77 |e file s|lice.psw|
|00003b70| 20 69 73 20 6c 69 73 74 | 65 64 20 62 65 6c 6f 77 | is list|ed below|
|00003b80| 2e 20 20 54 68 69 73 20 | 69 73 20 61 20 67 6f 6f |. This |is a goo|
|00003b90| 64 20 65 78 61 6d 70 6c | 65 20 6f 66 20 74 68 65 |d exampl|e of the|
|00003ba0| 20 6b 69 6e 64 20 6f 66 | 20 70 72 6f 67 72 61 6d | kind of| program|
|00003bb0| 73 20 70 72 6f 66 65 73 | 73 69 6f 6e 61 6c 20 50 |s profes|sional P|
|00003bc0| 6f 73 74 53 63 72 69 70 | 74 20 68 61 63 6b 65 72 |ostScrip|t hacker|
|00003bd0| 73 20 63 61 6e 20 63 72 | 65 61 74 65 2e 20 20 4e |s can cr|eate. N|
|00003be0| 6f 74 20 76 65 72 79 20 | 6c 65 67 69 62 6c 65 20 |ot very |legible |
|00003bf0| 62 79 20 74 68 65 20 61 | 76 65 72 61 67 65 20 68 |by the a|verage h|
|00003c00| 75 6d 61 6e 20 62 75 74 | 20 76 65 72 79 20 75 73 |uman but| very us|
|00003c10| 65 66 75 6c 2c 20 6f 6e | 63 65 20 77 65 20 6b 6e |eful, on|ce we kn|
|00003c20| 6f 77 20 74 68 61 74 20 | 6f 75 72 20 70 72 6f 67 |ow that |our prog|
|00003c30| 72 61 6d 20 6a 75 73 74 | 20 6e 65 65 64 73 20 74 |ram just| needs t|
|00003c40| 6f 20 61 64 64 20 6f 6e | 65 20 6c 69 6e 65 20 74 |o add on|e line t|
|00003c50| 6f 20 74 68 65 69 72 20 | 43 20 70 72 6f 67 72 61 |o their |C progra|
|00003c60| 6d 20 74 6f 20 75 73 65 | 20 74 68 69 73 2e 0d 03 |m to use| this...|
|00003c70| 85 fc 00 6c 02 0a 00 6c | 02 0e 02 44 06 30 f7 ff |...l...l|...D.0..|
|00003c80| 00 15 0a 01 f7 0d 46 69 | 67 75 72 65 20 39 2d 33 |......Fi|gure 9-3|
|00003c90| 3a 20 50 72 6f 67 72 61 | 6d 20 74 6f 20 44 65 6d |: Progra|m to Dem|
|00003ca0| 6f 6e 73 74 72 61 74 65 | 20 74 68 65 20 44 72 61 |onstrate| the Dra|
|00003cb0| 77 53 6c 69 63 65 20 66 | 75 6e 63 74 69 6f 6e ff |wSlice f|unction.|
|00003cc0| 00 15 0a 00 f7 0d 0d 57 | 65 20 77 69 6c 6c 20 75 |.......W|e will u|
|00003cd0| 73 65 20 74 68 65 73 65 | 20 72 6f 75 74 69 6e 65 |se these| routine|
|00003ce0| 73 20 6c 61 74 65 72 20 | 6f 6e 20 66 6f 72 20 6f |s later |on for o|
|00003cf0| 75 72 20 50 69 65 43 68 | 61 72 74 20 61 6e 64 20 |ur PieCh|art and |
|00003d00| 44 69 73 6b 55 73 65 20 | 70 72 6f 67 72 61 6d 73 |DiskUse |programs|
|00003d10| 20 6c 61 74 65 72 20 69 | 6e 20 74 68 65 20 74 65 | later i|n the te|
|00003d20| 78 74 2e 0d 0d fc 00 48 | 02 0a 00 48 00 0e 02 44 |xt.....H|...H...D|
|00003d30| 06 30 f7 ff 00 15 12 01 | f7 45 78 61 6d 70 6c 65 |.0......|.Example|
|00003d40| 20 39 2d 34 3a 20 46 72 | 61 63 74 61 6c 20 54 72 | 9-4: Fr|actal Tr|
|00003d50| 65 65 73 0d fc 00 6c 02 | 0a 00 6c 00 0e 02 44 06 |ees...l.|..l...D.|
|00003d60| 30 f7 0d ff 00 15 0a 00 | f7 45 61 72 6c 69 65 72 |0.......|.Earlier|
|00003d70| 20 69 6e 20 74 68 65 20 | 74 65 78 74 20 77 65 20 | in the |text we |
|00003d80| 64 69 73 63 75 73 73 65 | 64 20 68 6f 77 20 76 69 |discusse|d how vi|
|00003d90| 73 75 61 6c 69 7a 61 74 | 69 6f 6e 20 74 6f 6f 6c |sualizat|ion tool|
|00003da0| 73 20 77 69 6c 6c 20 68 | 65 6c 70 20 75 73 20 22 |s will h|elp us "|
|00003db0| 73 65 65 22 20 74 68 69 | 6e 67 73 20 74 68 61 74 |see" thi|ngs that|
|00003dc0| 20 63 61 6e 20 6e 6f 74 | 20 62 65 20 65 61 73 69 | can not| be easi|
|00003dd0| 6c 79 20 75 6e 64 65 72 | 73 74 6f 6f 64 2e 20 20 |ly under|stood. |
|00003de0| 4f 6e 65 20 65 78 61 6d | 70 6c 65 20 6f 66 20 74 |One exam|ple of t|
|00003df0| 68 69 73 20 69 73 20 74 | 68 65 20 75 73 65 20 6f |his is t|he use o|
|00003e00| 66 20 72 65 63 75 72 73 | 69 6f 6e 2e 20 20 57 65 |f recurs|ion. We|
|00003e10| 20 63 61 6e 20 72 65 61 | 64 20 70 61 67 65 73 20 | can rea|d pages |
|00003e20| 61 6e 64 20 70 61 67 65 | 73 20 6f 66 20 64 65 74 |and page|s of det|
|00003e30| 61 69 6c 65 64 20 65 78 | 70 6c 61 6e 61 74 69 6f |ailed ex|planatio|
|00003e40| 6e 20 62 75 74 20 75 6e | 6c 65 73 73 20 77 65 20 |n but un|less we |
|00003e50| 63 61 6e 20 68 61 76 65 | 20 61 20 63 68 61 6e 63 |can have| a chanc|
|00003e60| 65 20 74 6f 20 6d 61 6e | 69 70 75 6c 61 74 65 20 |e to man|ipulate |
|00003e70| 61 20 63 6f 6e 63 72 65 | 74 65 20 65 78 61 6d 70 |a concre|te examp|
|00003e80| 6c 65 20 6d 61 6e 79 20 | 6f 66 20 74 68 65 20 62 |le many |of the b|
|00003e90| 61 73 69 63 20 70 72 69 | 6e 63 69 70 61 6c 73 20 |asic pri|ncipals |
|00003ea0| 63 6f 75 6c 64 20 65 6c | 75 64 65 20 6f 75 72 20 |could el|ude our |
|00003eb0| 75 6e 64 65 72 73 74 61 | 6e 64 69 6e 67 2e 0d 0d |understa|nding...|
|00003ec0| 49 6e 20 74 68 65 20 50 | 6f 73 74 53 63 72 69 70 |In the P|ostScrip|
|00003ed0| 74 20 4c 61 6e 67 75 61 | 67 65 20 54 75 74 6f 72 |t Langua|ge Tutor|
|00003ee0| 69 61 6c 20 61 6e 64 20 | 43 6f 6f 6b 62 6f 6f 6b |ial and |Cookbook|
|00003ef0| 20 74 68 65 69 72 20 69 | 73 20 61 20 6e 69 63 65 | their i|s a nice|
|00003f00| 20 65 78 61 6d 70 6c 65 | 20 70 72 6f 67 72 61 6d | example| program|
|00003f10| 20 63 61 6c 6c 65 64 20 | 74 68 65 20 46 72 61 63 | called |the Frac|
|00003f20| 74 61 6c 20 41 72 72 6f | 77 2e 20 20 54 68 65 72 |tal Arro|w. Ther|
|00003f30| 65 20 69 73 20 61 20 63 | 6f 70 79 20 6f 66 20 74 |e is a c|opy of t|
|00003f40| 68 69 73 20 70 72 6f 67 | 72 61 6d 20 69 6e 20 74 |his prog|ram in t|
|00003f50| 68 65 20 66 69 6c 65 20 | 2f 4e 65 78 74 44 65 76 |he file |/NextDev|
|00003f60| 65 6c 6f 70 65 72 2f 45 | 78 61 6d 70 6c 65 73 2f |eloper/E|xamples/|
|00003f70| 50 6f 73 74 73 63 72 69 | 70 74 2f 54 72 65 65 2e |Postscri|pt/Tree.|
|00003f80| 70 73 2e 20 20 49 74 20 | 68 61 73 20 61 20 68 69 |ps. It |has a hi|
|00003f90| 6e 74 20 6f 66 20 74 68 | 65 20 62 65 61 75 74 79 |nt of th|e beauty|
|00003fa0| 20 6f 66 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 | of the |program |
|00003fb0| 62 79 20 74 68 65 20 63 | 6f 6d 6d 65 6e 74 20 6c |by the c|omment l|
|00003fc0| 69 6e 65 73 20 61 64 64 | 65 64 2e 0d 0d fc 00 91 |ines add|ed......|
|00003fd0| 02 0a 00 91 00 0e 02 44 | 06 30 f7 ff 00 16 0a 00 |.......D|.0......|
|00003fe0| f7 0d 0d 0d 0d 0d 0d 25 | 21 50 53 2d 41 64 6f 62 |.......%|!PS-Adob|
|00003ff0| 65 2d 32 2e 30 0d 02 ee | ff 00 15 0a 01 f7 46 69 |e-2.0...|......Fi|
|00004000| 67 75 72 65 20 39 2d 34 | 3a 20 46 72 61 63 74 61 |gure 9-4|: Fracta|
|00004010| 6c 20 41 72 72 6f 77 ff | 00 15 0a 00 f7 0d fc 00 |l Arrow.|........|
|00004020| 91 02 0a 00 6c 00 0e 02 | 44 06 30 f7 0d 0d fc 00 |....l...|D.0.....|
|00004030| 6c 02 0a 00 6c 00 0e 02 | 44 06 30 f7 41 6c 74 68 |l...l...|D.0.Alth|
|00004040| 6f 75 67 68 20 74 68 65 | 20 66 72 61 63 74 61 6c |ough the| fractal|
|00004050| 20 61 72 72 6f 77 20 69 | 73 20 76 65 72 79 20 6e | arrow i|s very n|
|00004060| 69 63 65 2c 20 61 6e 64 | 20 69 74 20 69 73 20 61 |ice, and| it is a|
|00004070| 20 6e 69 63 65 20 76 69 | 73 75 61 6c 20 64 69 73 | nice vi|sual dis|
|00004080| 70 6c 61 79 20 6f 72 20 | 72 65 63 75 72 73 69 6f |play or |recursio|
|00004090| 6e 20 69 74 20 77 6f 75 | 6c 64 20 62 65 20 6d 75 |n it wou|ld be mu|
|000040a0| 63 68 20 6d 6f 72 65 20 | 66 75 6e 20 74 6f 20 63 |ch more |fun to c|
|000040b0| 68 61 6e 67 65 20 76 61 | 72 69 6f 75 73 20 70 61 |hange va|rious pa|
|000040c0| 72 61 6d 65 74 65 72 73 | 20 61 6e 64 20 73 65 65 |rameters| and see|
|000040d0| 20 77 68 61 74 20 64 69 | 66 66 65 72 65 6e 74 20 | what di|fferent |
|000040e0| 70 61 74 74 65 72 6e 73 | 20 77 69 6c 6c 20 62 65 |patterns| will be|
|000040f0| 20 63 72 65 61 74 65 64 | 2e 20 20 54 68 65 20 69 | created|. The i|
|00004100| 6e 74 65 72 61 63 74 69 | 76 65 20 6e 61 74 75 72 |nteracti|ve natur|
|00004110| 65 20 6f 66 20 64 69 73 | 70 6c 61 79 20 50 6f 73 |e of dis|play Pos|
|00004120| 74 53 63 72 69 70 74 20 | 61 6e 64 20 49 6e 74 65 |tScript |and Inte|
|00004130| 72 66 61 63 65 20 42 75 | 69 6c 64 65 72 20 61 6c |rface Bu|ilder al|
|00004140| 6c 6f 77 73 20 75 73 20 | 74 6f 20 64 6f 20 74 68 |lows us |to do th|
|00004150| 69 73 20 69 6e 20 61 20 | 6e 69 63 65 20 65 61 73 |is in a |nice eas|
|00004160| 79 20 6d 61 6e 6e 65 72 | 2e 20 20 20 49 66 20 79 |y manner|. If y|
|00004170| 6f 75 20 6c 6f 6f 6b 20 | 63 6c 6f 73 65 6c 79 20 |ou look |closely |
|00004180| 61 74 20 74 68 65 20 66 | 72 61 63 74 41 72 72 6f |at the f|ractArro|
|00004190| 77 20 70 72 6f 67 72 61 | 6d 2c 20 79 6f 75 20 77 |w progra|m, you w|
|000041a0| 69 6c 6c 20 73 65 65 20 | 69 74 20 69 73 20 72 65 |ill see |it is re|
|000041b0| 63 75 72 73 69 76 65 2e | 20 20 49 6e 20 74 68 65 |cursive.| In the|
|000041c0| 20 66 75 6e 63 74 69 6f | 6e 20 64 65 66 69 6e 69 | functio|n defini|
|000041d0| 74 69 6f 6e 20 66 6f 72 | 20 66 72 61 63 74 54 72 |tion for| fractTr|
|000041e0| 65 65 20 74 68 65 72 65 | 20 61 72 65 20 74 77 6f |ee there| are two|
|000041f0| 20 63 61 6c 6c 73 20 74 | 6f 20 66 72 61 63 74 54 | calls t|o fractT|
|00004200| 72 65 65 2e 20 20 46 72 | 6f 6d 20 6f 75 72 20 63 |ree. Fr|om our c|
|00004210| 6f 6d 70 75 74 65 72 20 | 73 63 69 65 6e 63 65 20 |omputer |science |
|00004220| 66 75 6e 64 61 6d 65 6e | 74 61 6c 73 20 77 65 20 |fundamen|tals we |
|00004230| 6d 69 67 68 74 20 72 65 | 63 61 6c 6c 20 74 68 61 |might re|call tha|
|00004240| 74 20 61 6c 6c 20 73 74 | 61 63 6b 20 6f 72 69 65 |t all st|ack orie|
|00004250| 6e 74 65 64 20 6c 61 6e | 67 75 61 67 65 73 20 61 |nted lan|guages a|
|00004260| 72 65 20 72 65 63 75 72 | 73 69 76 65 20 69 6e 20 |re recur|sive in |
|00004270| 6e 61 74 75 72 65 2e 20 | 20 57 69 74 68 20 50 6f |nature. | With Po|
|00004280| 73 74 53 63 72 69 70 74 | 20 61 6e 64 20 4e 65 58 |stScript| and NeX|
|00004290| 54 73 74 65 70 20 77 65 | 20 63 61 6e 20 65 61 73 |Tstep we| can eas|
|000042a0| 69 6c 79 20 62 75 69 6c | 64 20 73 6d 61 6c 6c 20 |ily buil|d small |
|000042b0| 70 72 6f 67 72 61 6d 73 | 20 74 68 61 74 20 61 6c |programs| that al|
|000042c0| 6c 6f 77 20 75 73 20 74 | 6f 20 76 69 73 75 61 6c |low us t|o visual|
|000042d0| 69 7a 65 20 77 68 61 74 | 20 69 73 20 67 6f 69 6e |ize what| is goin|
|000042e0| 67 20 6f 6e 2e 0d 01 fe | 0d 54 68 65 20 70 72 6f |g on....|.The pro|
|000042f0| 67 72 61 6d 20 69 73 20 | 69 64 65 6e 74 69 63 61 |gram is |identica|
|00004300| 6c 20 74 6f 20 74 68 65 | 20 64 72 61 77 4c 69 6e |l to the| drawLin|
|00004310| 65 20 70 72 6f 67 72 61 | 6d 20 75 73 65 64 20 65 |e progra|m used e|
|00004320| 61 72 6c 69 65 72 20 62 | 75 74 20 77 65 20 77 69 |arlier b|ut we wi|
|00004330| 6c 6c 20 6e 6f 77 20 75 | 73 65 20 74 68 65 20 74 |ll now u|se the t|
|00004340| 65 6e 20 73 6c 69 64 65 | 72 73 20 74 6f 20 63 6f |en slide|rs to co|
|00004350| 6e 74 72 6f 6c 20 73 6f | 6d 65 20 6f 66 20 74 68 |ntrol so|me of th|
|00004360| 65 20 70 61 72 61 6d 65 | 74 65 72 73 20 73 75 63 |e parame|ters suc|
|00004370| 68 20 61 73 20 74 68 65 | 20 64 65 70 74 68 20 6f |h as the| depth o|
|00004380| 66 20 72 65 63 75 72 73 | 69 6f 6e 2c 20 74 68 65 |f recurs|ion, the|
|00004390| 20 61 6e 67 6c 65 20 62 | 65 74 77 65 65 6e 20 74 | angle b|etween t|
|000043a0| 68 65 20 72 6f 74 61 74 | 65 64 20 63 6f 6f 72 64 |he rotat|ed coord|
|000043b0| 69 6e 61 74 65 20 73 79 | 73 74 65 6d 73 20 61 6e |inate sy|stems an|
|000043c0| 64 20 74 68 65 20 6c 69 | 6e 65 20 63 68 61 72 61 |d the li|ne chara|
|000043d0| 63 74 65 72 69 73 74 69 | 63 73 2e 20 20 54 68 65 |cteristi|cs. The|
|000043e0| 20 68 65 61 64 65 72 20 | 66 69 6c 65 20 77 69 6c | header |file wil|
|000043f0| 6c 20 63 6f 6e 74 61 69 | 6e 20 74 68 65 20 69 6e |l contai|n the in|
|00004400| 73 74 61 6e 63 65 20 76 | 61 72 69 61 62 6c 65 73 |stance v|ariables|
|00004410| 20 74 68 61 74 20 61 72 | 65 20 75 73 65 64 20 74 | that ar|e used t|
|00004420| 6f 20 63 6f 6e 74 72 6f | 6c 20 74 68 65 20 64 72 |o contro|l the dr|
|00004430| 61 77 69 6e 67 2e 20 20 | 54 68 65 69 72 20 77 69 |awing. |Their wi|
|00004440| 6c 6c 20 62 65 20 74 65 | 6e 20 73 6c 69 64 65 72 |ll be te|n slider|
|00004450| 73 20 65 61 63 68 20 68 | 6f 6f 6b 65 64 20 75 70 |s each h|ooked up|
|00004460| 20 74 6f 20 74 65 6e 20 | 61 63 74 69 6f 6e 20 6d | to ten |action m|
|00004470| 65 74 68 6f 64 73 20 66 | 6f 72 20 6f 75 72 20 6f |ethods f|or our o|
|00004480| 62 6a 65 63 74 2e 20 20 | 45 61 63 68 20 61 63 74 |bject. |Each act|
|00004490| 69 6f 6e 20 6d 65 74 68 | 6f 64 20 77 69 6c 6c 20 |ion meth|od will |
|000044a0| 67 65 74 20 74 68 65 20 | 75 70 64 61 74 65 64 20 |get the |updated |
|000044b0| 76 61 6c 75 65 20 66 72 | 6f 6d 20 74 68 65 20 73 |value fr|om the s|
|000044c0| 6c 69 64 65 72 20 61 6e | 64 20 74 68 65 6e 20 72 |lider an|d then r|
|000044d0| 65 2d 64 69 73 70 6c 61 | 79 20 74 68 65 20 6f 62 |e-displa|y the ob|
|000044e0| 6a 65 63 74 2e 0d 01 d5 | 0d fc 00 90 02 0a 00 90 |ject....|........|
|000044f0| 00 0e 02 d0 06 30 f7 ff | 00 16 0a 00 f7 23 69 6d |.....0..|.....#im|
|00004500| 70 6f 72 74 20 3c 61 70 | 70 6b 69 74 2f 56 69 65 |port <ap|pkit/Vie|
|00004510| 77 2e 68 3e 0d 0d 40 69 | 6e 74 65 72 66 61 63 65 |w.h>..@i|nterface|
|00004520| 20 4d 79 56 69 65 77 3a | 56 69 65 77 0d 7b 0d 20 | MyView:|View.{. |
|00004530| 20 20 66 6c 6f 61 74 20 | 62 72 61 6e 63 68 43 68 | float |branchCh|
|00004540| 61 6e 67 65 2c 20 62 72 | 61 6e 63 68 4c 65 6e 67 |ange, br|anchLeng|
|00004550| 74 68 2c 20 68 65 69 67 | 68 74 2c 20 6c 65 66 74 |th, heig|ht, left|
|00004560| 42 72 61 6e 63 68 2c 20 | 09 6c 69 6e 65 57 69 64 |Branch, |.lineWid|
|00004570| 74 68 2c 20 6d 6f 76 65 | 4c 65 66 74 2c 20 6d 6f |th, move|Left, mo|
|00004580| 76 65 52 69 67 68 74 2c | 20 72 69 67 68 74 42 72 |veRight,| rightBr|
|00004590| 61 6e 63 68 2c 20 77 69 | 64 74 68 2c 20 09 77 69 |anch, wi|dth, .wi|
|000045a0| 64 74 68 43 68 61 6e 67 | 65 2c 20 6d 61 78 44 65 |dthChang|e, maxDe|
|000045b0| 70 74 68 3b 0d 7d 0d 0d | 2b 20 6e 65 77 46 72 61 |pth;.}..|+ newFra|
|000045c0| 6d 65 3a 28 63 6f 6e 73 | 74 20 4e 58 52 65 63 74 |me:(cons|t NXRect|
|000045d0| 20 2a 29 74 46 3b 0d 2d | 20 62 72 61 6e 63 68 43 | *)tF;.-| branchC|
|000045e0| 68 61 6e 67 65 3a 73 65 | 6e 64 65 72 3b 0d 2d 20 |hange:se|nder;.- |
|000045f0| 77 69 64 74 68 43 68 61 | 6e 67 65 3a 73 65 6e 64 |widthCha|nge:send|
|00004600| 65 72 3b 0d 2d 20 6d 6f | 76 65 4c 65 66 74 3a 73 |er;.- mo|veLeft:s|
|00004610| 65 6e 64 65 72 3b 0d 2d | 20 68 65 69 67 68 74 3a |ender;.-| height:|
|00004620| 73 65 6e 64 65 72 3b 0d | 2d 20 62 72 61 6e 63 68 |sender;.|- branch|
|00004630| 4c 65 6e 67 74 68 3a 73 | 65 6e 64 65 72 3b 0d 2d |Length:s|ender;.-|
|00004640| 20 72 69 67 68 74 42 72 | 61 6e 63 68 3a 73 65 6e | rightBr|anch:sen|
|00004650| 64 65 72 3b 0d 2d 20 6c | 65 66 74 42 72 61 6e 63 |der;.- l|eftBranc|
|00004660| 68 3a 73 65 6e 64 65 72 | 3b 0d 2d 20 6c 69 6e 65 |h:sender|;.- line|
|00004670| 57 69 64 74 68 3a 73 65 | 6e 64 65 72 3b 0d 2d 20 |Width:se|nder;.- |
|00004680| 6d 6f 76 65 52 69 67 68 | 74 3a 73 65 6e 64 65 72 |moveRigh|t:sender|
|00004690| 3b 0d 2d 20 77 69 64 74 | 68 3a 73 65 6e 64 65 72 |;.- widt|h:sender|
|000046a0| 3b 0d 0d 40 65 6e 64 0d | fc 00 6c 02 0a 00 6c 00 |;..@end.|..l...l.|
|000046b0| 0e 02 44 06 30 f7 ff 00 | 15 0a 00 f7 0d 02 d6 57 |..D.0...|.......W|
|000046c0| 65 20 77 69 6c 6c 20 6e | 65 65 64 20 74 6f 20 69 |e will n|eed to i|
|000046d0| 6e 69 74 69 61 6c 69 7a | 65 20 61 6c 6c 20 6f 66 |nitializ|e all of|
|000046e0| 20 6f 75 72 20 64 72 61 | 77 69 6e 67 20 70 61 72 | our dra|wing par|
|000046f0| 61 6d 65 74 65 72 73 ff | 00 15 0a 00 f7 2e 20 20 |ameters.|...... |
|00004700| 54 68 65 20 6e 65 77 46 | 72 61 6d 65 3a 20 66 75 |The newF|rame: fu|
|00004710| 6e 63 74 69 6f 6e 20 62 | 65 6c 6f 77 20 68 61 73 |nction b|elow has|
|00004720| 20 73 6f 6d 65 20 73 61 | 6d 70 6c 65 73 20 61 6c | some sa|mples al|
|00004730| 74 68 6f 75 67 68 20 79 | 6f 75 20 6d 69 67 68 74 |though y|ou might|
|00004740| 20 77 61 6e 74 20 74 6f | 20 75 73 65 20 73 6f 6d | want to| use som|
|00004750| 65 20 6f 66 20 79 6f 75 | 72 20 6f 77 6e 20 64 65 |e of you|r own de|
|00004760| 66 61 75 6c 74 73 2e 0d | fc 00 90 02 0a 00 90 00 |faults..|........|
|00004770| 0e 02 d0 06 30 f7 ff 00 | 16 0a 00 f7 0d 2b 6e 65 |....0...|.....+ne|
|00004780| 77 46 72 61 6d 65 3a 28 | 63 6f 6e 73 74 20 4e 58 |wFrame:(|const NX|
|00004790| 52 65 63 74 20 2a 29 74 | 46 20 7b 0d 20 20 20 20 |Rect *)t|F {. |
|000047a0| 73 65 6c 66 20 3d 20 5b | 73 75 70 65 72 20 6e 65 |self = [|super ne|
|000047b0| 77 46 72 61 6d 65 3a 74 | 46 5d 3b 0d 20 20 20 20 |wFrame:t|F];. |
|000047c0| 62 72 61 6e 63 68 43 68 | 61 6e 67 65 20 3d 20 2e |branchCh|ange = .|
|000047d0| 37 3b 0d 20 20 20 20 77 | 69 64 74 68 43 68 61 6e |7;. w|idthChan|
|000047e0| 67 65 20 3d 20 2e 37 3b | 0d 20 20 20 20 6d 6f 76 |ge = .7;|. mov|
|000047f0| 65 4c 65 66 74 20 3d 20 | 30 2e 30 3b 0d 20 20 20 |eLeft = |0.0;. |
|00004800| 20 68 65 69 67 68 74 20 | 3d 20 31 2e 30 3b 0d 20 | height |= 1.0;. |
|00004810| 20 20 20 62 72 61 6e 63 | 68 4c 65 6e 67 74 68 20 | branc|hLength |
|00004820| 3d 20 32 30 30 2e 30 3b | 0d 20 20 20 20 72 69 67 |= 200.0;|. rig|
|00004830| 68 74 42 72 61 6e 63 68 | 20 3d 20 35 30 2e 30 3b |htBranch| = 50.0;|
|00004840| 0d 20 20 20 20 6c 65 66 | 74 42 72 61 6e 63 68 20 |. lef|tBranch |
|00004850| 3d 20 2d 33 30 2e 30 3b | 0d 20 20 20 20 6c 69 6e |= -30.0;|. lin|
|00004860| 65 57 69 64 74 68 20 3d | 20 34 30 2e 30 3b 0d 20 |eWidth =| 40.0;. |
|00004870| 20 20 20 6d 6f 76 65 52 | 69 67 68 74 20 3d 20 32 | moveR|ight = 2|
|00004880| 30 30 2e 30 3b 0d 20 20 | 20 20 77 69 64 74 68 20 |00.0;. | width |
|00004890| 3d 20 2e 38 3b 0d 20 20 | 20 20 6d 61 78 44 65 70 |= .8;. | maxDep|
|000048a0| 74 68 20 3d 20 39 2e 30 | 3b 0d 20 20 20 20 6d 6f |th = 9.0|;. mo|
|000048b0| 76 65 4c 65 66 74 20 3d | 20 36 2e 30 3b 0d 7d 0d |veLeft =| 6.0;.}.|
|000048c0| 0d fc 00 6b 02 0a 00 6b | 00 0e 02 d0 06 30 f7 ff |...k...k|.....0..|
|000048d0| 00 15 0a 00 f7 54 68 65 | 20 64 72 61 77 69 6e 67 |.....The| drawing|
|000048e0| 20 70 72 6f 67 72 61 6d | 2c 20 6c 69 6b 65 20 74 | program|, like t|
|000048f0| 68 65 20 50 69 65 53 6c | 69 63 65 20 70 72 6f 67 |he PieSl|ice prog|
|00004900| 72 61 6d 20 61 72 65 20 | 76 65 72 79 20 73 69 6d |ram are |very sim|
|00004910| 70 6c 65 2e 20 20 54 68 | 69 73 20 6f 6e 65 20 6a |ple. Th|is one j|
|00004920| 75 73 74 20 70 61 73 73 | 65 73 20 74 68 65 20 70 |ust pass|es the p|
|00004930| 61 72 61 6d 65 74 65 72 | 73 20 6f 66 66 20 74 6f |arameter|s off to|
|00004940| 20 61 20 72 6f 75 74 69 | 6e 65 20 63 61 6c 6c 65 | a routi|ne calle|
|00004950| 64 20 64 6f 54 72 65 65 | 20 77 68 69 63 68 20 68 |d doTree| which h|
|00004960| 61 73 20 74 68 65 20 73 | 61 6d 65 20 63 68 61 6e |as the s|ame chan|
|00004970| 67 65 73 20 61 73 20 74 | 68 65 20 64 72 61 77 53 |ges as t|he drawS|
|00004980| 6c 69 63 65 20 70 72 6f | 67 72 61 6d 2e 0d ff 00 |lice pro|gram....|
|00004990| 16 0a 00 f7 0d 02 68 fc | 00 90 02 0a 00 90 00 0e |......h.|........|
|000049a0| 02 d0 06 30 f7 2d 20 64 | 72 61 77 53 65 6c 66 3a |...0.- d|rawSelf:|
|000049b0| 28 4e 58 52 65 63 74 2a | 29 72 20 3a 28 69 6e 74 |(NXRect*|)r :(int|
|000049c0| 29 63 0d 7b 0d 20 20 20 | 20 4e 58 45 72 61 73 65 |)c.{. | NXErase|
|000049d0| 52 65 63 74 28 26 62 6f | 75 6e 64 73 29 3b 0d 20 |Rect(&bo|unds);. |
|000049e0| 20 20 20 50 53 73 65 74 | 67 72 61 79 28 4e 58 5f | PSset|gray(NX_|
|000049f0| 42 4c 41 43 4b 29 3b 0d | 20 20 20 20 50 53 73 65 |BLACK);.| PSse|
|00004a00| 74 6c 69 6e 65 77 69 64 | 74 68 28 6c 69 6e 65 57 |tlinewid|th(lineW|
|00004a10| 69 64 74 68 29 3b 0d 20 | 20 20 20 64 6f 54 72 65 |idth);. | doTre|
|00004a20| 65 28 6d 6f 76 65 4c 65 | 66 74 2c 20 6c 65 66 74 |e(moveLe|ft, left|
|00004a30| 42 72 61 6e 63 68 2c 20 | 72 69 67 68 74 42 72 61 |Branch, |rightBra|
|00004a40| 6e 63 68 2c 20 62 72 61 | 6e 63 68 4c 65 6e 67 74 |nch, bra|nchLengt|
|00004a50| 68 2c 20 09 6d 6f 76 65 | 52 69 67 68 74 2c 20 77 |h, .move|Right, w|
|00004a60| 69 64 74 68 2c 20 68 65 | 69 67 68 74 2c 20 6c 69 |idth, he|ight, li|
|00004a70| 6e 65 57 69 64 74 68 2c | 20 62 72 61 6e 63 68 43 |neWidth,| branchC|
|00004a80| 68 61 6e 67 65 2c 20 09 | 77 69 64 74 68 43 68 61 |hange, .|widthCha|
|00004a90| 6e 67 65 29 3b 0d 20 20 | 20 20 72 65 74 75 72 6e |nge);. | return|
|00004aa0| 20 73 65 6c 66 3b 0d 7d | 0d 0d fc 00 6c 02 0a 00 | self;.}|....l...|
|00004ab0| 6c 00 0e 02 d0 06 30 f7 | ff 00 15 0a 00 f7 54 68 |l.....0.|......Th|
|00004ac0| 65 20 72 65 73 75 6c 74 | 73 20 73 70 65 61 6b 20 |e result|s speak |
|00004ad0| 66 6f 72 20 74 68 65 6d | 73 65 6c 76 65 73 2e 20 |for them|selves. |
|00004ae0| 20 48 65 72 65 20 61 72 | 65 20 61 20 66 65 77 20 | Here ar|e a few |
|00004af0| 73 61 6d 70 6c 65 73 20 | 67 65 6e 65 72 61 74 65 |samples |generate|
|00004b00| 64 20 62 79 20 76 61 72 | 69 6f 75 73 20 63 6f 6d |d by var|ious com|
|00004b10| 62 69 6e 61 74 69 6f 6e | 73 20 6f 66 20 74 68 65 |bination|s of the|
|00004b20| 20 74 65 6e 20 70 61 72 | 61 6d 65 74 65 72 73 2e | ten par|ameters.|
|00004b30| 20 20 54 68 65 72 65 20 | 61 72 65 20 61 6c 6d 6f | There |are almo|
|00004b40| 73 74 20 61 6e 20 69 6e | 66 69 6e 69 74 65 20 6e |st an in|finite n|
|00004b50| 75 6d 62 65 72 20 6f 66 | 20 74 68 65 6d 2e 20 20 |umber of| them. |
|00004b60| 54 68 69 73 20 69 73 20 | 6f 6e 65 20 70 61 72 74 |This is |one part|
|00004b70| 20 74 68 61 74 20 69 73 | 20 76 65 72 79 20 68 61 | that is| very ha|
|00004b80| 72 64 20 74 6f 20 70 75 | 74 20 69 6e 20 61 20 74 |rd to pu|t in a t|
|00004b90| 65 78 74 20 62 65 63 61 | 75 73 65 20 69 74 20 64 |ext beca|use it d|
|00004ba0| 6f 65 73 20 6e 6f 74 20 | 73 68 6f 77 20 74 68 65 |oes not |show the|
|00004bb0| 20 69 6e 74 65 72 61 63 | 74 69 76 65 20 6e 61 74 | interac|tive nat|
|00004bc0| 75 72 65 20 6f 66 20 74 | 68 65 20 70 72 6f 67 72 |ure of t|he progr|
|00004bd0| 61 6d 20 61 74 20 61 6c | 6c 2e ff 00 16 0a 00 f7 |am at al|l.......|
|00004be0| 0d fc 00 90 02 0a 00 90 | 00 0e 02 d0 06 30 f7 0d |........|.....0..|
|00004bf0| fc 00 90 02 0a 00 90 02 | 0e 02 d0 06 30 f7 0d 00 |........|....0...|
|00004c00| 34 ff 00 15 0a 01 f7 46 | 69 67 75 72 65 20 39 2d |4......F|igure 9-|
|00004c10| 35 3a 20 46 72 61 63 74 | 61 6c 20 54 72 65 65 ff |5: Fract|al Tree.|
|00004c20| 00 16 0a 00 f7 0d fc 00 | 90 02 0a 00 90 00 0e 02 |........|........|
|00004c30| d0 06 30 f7 0d 00 2d fc | 00 6c 02 0a 00 6c 02 0e |..0...-.|.l...l..|
|00004c40| 02 d0 06 30 f7 fb 00 00 | 00 01 01 1b 00 ea 57 4e |...0....|......WN|
|00004c50| 47 72 61 70 68 69 63 2e | 36 35 31 33 35 32 2e 65 |Graphic.|651352.e|
|00004c60| 70 73 f7 0d 03 5e ff 00 | 15 0a 01 f7 46 69 67 75 |ps...^..|....Figu|
|00004c70| 72 65 20 39 2d 36 3a 20 | 43 68 61 6e 67 69 6e 67 |re 9-6: |Changing|
|00004c80| 20 70 61 72 61 6d 65 74 | 65 72 73 20 74 6f 20 74 | paramet|ers to t|
|00004c90| 68 65 20 46 72 61 63 74 | 61 6c 20 54 72 65 65 0d |he Fract|al Tree.|
|00004ca0| ff 00 16 0a 00 f7 0d fc | 00 48 02 0a 00 48 00 0e |........|.H...H..|
|00004cb0| 02 d0 06 30 f7 ff 00 15 | 12 01 f7 f9 00 f7 55 73 |...0....|......Us|
|00004cc0| 69 6e 67 20 6e 6f 6e 2d | 72 65 74 61 69 6e 65 64 |ing non-|retained|
|00004cd0| 20 77 69 6e 64 6f 77 73 | 0d fc 00 6c 02 0a 00 6c | windows|...l...l|
|00004ce0| 00 0e 02 d0 06 30 f7 0d | fc 00 6c 02 0a 00 6c 00 |.....0..|..l...l.|
|00004cf0| 0e 02 44 06 30 f7 ff 00 | 15 0a 00 f7 57 68 65 6e |..D.0...|....When|
|00004d00| 20 77 65 20 62 75 69 6c | 64 20 74 68 65 20 66 72 | we buil|d the fr|
|00004d10| 61 63 74 54 72 65 65 20 | 70 72 6f 67 72 61 6d 20 |actTree |program |
|00004d20| 77 65 20 77 69 6c 6c 20 | 62 65 20 61 62 6c 65 20 |we will |be able |
|00004d30| 74 6f 20 67 65 6e 65 72 | 61 74 65 20 73 6f 6d 65 |to gener|ate some|
|00004d40| 20 63 6f 6d 70 6c 65 78 | 20 67 72 61 70 68 69 63 | complex| graphic|
|00004d50| 73 2e 20 20 45 61 63 68 | 20 61 64 64 69 74 69 6f |s. Each| additio|
|00004d60| 6e 61 6c 20 6c 65 76 65 | 6c 20 6f 66 20 72 65 63 |nal leve|l of rec|
|00004d70| 75 72 73 69 6f 6e 20 77 | 65 20 75 73 65 20 64 6f |ursion w|e use do|
|00004d80| 75 62 6c 65 73 20 74 68 | 65 20 6e 75 6d 62 65 72 |ubles th|e number|
|00004d90| 20 6f 66 20 6c 69 6e 65 | 73 20 74 6f 20 62 65 20 | of line|s to be |
|00004da0| 64 72 61 77 6e 2e 20 20 | 49 66 20 77 65 20 75 73 |drawn. |If we us|
|00004db0| 65 20 31 35 20 6c 65 76 | 65 6c 73 20 64 65 65 70 |e 15 lev|els deep|
|00004dc0| 20 74 68 61 74 20 69 73 | 20 32 2a 31 35 f9 03 f7 | that is| 2*15...|
|00004dd0| 32 f9 00 f7 2d 31 3d 20 | 34 34 39 20 70 61 74 68 |2...-1= |449 path|
|00004de0| 73 20 74 68 61 74 20 6d | 75 73 74 20 62 65 20 64 |s that m|ust be d|
|00004df0| 72 61 77 6e 2e 20 20 42 | 79 20 64 65 66 61 75 6c |rawn. B|y defaul|
|00004e00| 74 20 65 61 63 68 20 6f | 66 20 74 68 65 20 77 69 |t each o|f the wi|
|00004e10| 6e 64 6f 77 73 20 69 73 | 20 62 75 66 66 65 72 65 |ndows is| buffere|
|00004e20| 64 2e 20 20 41 6c 6c 20 | 74 68 65 20 64 72 61 77 |d. All |the draw|
|00004e30| 69 6e 67 20 69 73 20 64 | 6f 6e 65 20 69 6e 20 61 |ing is d|one in a|
|00004e40| 6e 20 6f 66 66 2d 73 63 | 72 65 65 6e 20 61 72 65 |n off-sc|reen are|
|00004e50| 61 20 6f 66 20 6d 65 6d | 6f 72 79 20 61 6e 64 20 |a of mem|ory and |
|00004e60| 6f 6e 6c 79 20 61 66 74 | 65 72 20 74 68 65 20 64 |only aft|er the d|
|00004e70| 72 61 77 69 6e 67 20 69 | 73 20 66 69 6e 69 73 68 |rawing i|s finish|
|00004e80| 65 64 20 77 69 6c 6c 20 | 77 65 20 73 65 65 20 74 |ed will |we see t|
|00004e90| 68 65 20 72 65 73 75 6c | 74 73 20 63 6f 6d 70 69 |he resul|ts compi|
|00004ea0| 6c 65 64 20 74 6f 20 74 | 68 65 20 73 63 72 65 65 |led to t|he scree|
|00004eb0| 6e 2e 20 20 54 68 69 73 | 20 63 61 6e 20 62 65 20 |n. This| can be |
|00004ec0| 61 20 62 69 74 20 61 6e | 6e 6f 79 69 6e 67 20 77 |a bit an|noying w|
|00004ed0| 68 65 6e 20 77 65 20 77 | 61 6e 74 20 74 6f 20 77 |hen we w|ant to w|
|00004ee0| 61 74 63 68 20 67 72 61 | 70 68 69 63 73 20 62 65 |atch gra|phics be|
|00004ef0| 69 6e 67 20 64 72 61 77 | 6e 2e 20 20 54 6f 20 67 |ing draw|n. To g|
|00004f00| 65 74 20 61 72 6f 75 6e | 64 20 74 68 69 73 20 77 |et aroun|d this w|
|00004f10| 65 20 6d 75 73 74 20 73 | 65 6c 65 63 74 20 74 68 |e must s|elect th|
|00004f20| 65 20 77 69 6e 64 6f 77 | 20 69 6e 20 49 6e 74 65 |e window| in Inte|
|00004f30| 72 66 61 63 65 20 42 75 | 69 6c 64 65 72 20 61 6e |rface Bu|ilder an|
|00004f40| 64 20 63 68 61 6e 67 65 | 20 74 68 65 20 62 61 63 |d change| the bac|
|00004f50| 6b 69 6e 67 20 74 79 70 | 65 20 74 6f 20 62 65 20 |king typ|e to be |
|00004f60| 6e 6f 6e 2d 72 65 74 61 | 69 6e 65 64 2e 20 20 54 |non-reta|ined. T|
|00004f70| 68 69 73 20 61 6c 6c 6f | 77 73 20 75 73 20 74 6f |his allo|ws us to|
|00004f80| 20 73 65 65 20 74 68 65 | 20 66 72 61 63 74 65 6c | see the| fractel|
|00004f90| 20 70 72 6f 67 72 61 6d | 73 20 61 73 20 74 68 65 | program|s as the|
|00004fa0| 79 20 61 72 65 20 62 65 | 69 6e 67 20 64 72 61 77 |y are be|ing draw|
|00004fb0| 6e 20 6f 6e 20 74 68 65 | 20 73 63 72 65 65 6e 2e |n on the| screen.|
|00004fc0| f9 00 f7 0d 00 c7 0d 59 | 6f 75 20 6d 69 67 68 74 |.......Y|ou might|
|00004fd0| 20 61 6c 73 6f 20 62 65 | 20 69 6e 74 65 72 65 73 | also be| interes|
|00004fe0| 74 65 64 20 69 6e 20 68 | 6f 77 20 79 6f 75 20 63 |ted in h|ow you c|
|00004ff0| 61 6e 20 6d 6f 76 65 20 | 74 68 65 73 65 20 67 72 |an move |these gr|
|00005000| 61 70 68 69 63 73 20 69 | 6e 74 6f 20 79 6f 75 72 |aphics i|nto your|
|00005010| 20 6f 74 68 65 72 20 70 | 72 6f 67 72 61 6d 73 20 | other p|rograms |
|00005020| 73 75 63 68 20 61 73 20 | 77 6f 72 64 20 70 72 6f |such as |word pro|
|00005030| 63 65 73 73 6f 72 73 20 | 61 6e 64 20 64 72 61 77 |cessors |and draw|
|00005040| 69 6e 67 20 70 72 6f 67 | 72 61 6d 73 2e 20 20 57 |ing prog|rams. W|
|00005050| 65 20 77 69 6c 6c 20 63 | 6f 76 65 72 20 74 68 61 |e will c|over tha|
|00005060| 74 20 69 6e 20 74 68 65 | 20 73 65 63 74 69 6f 6e |t in the| section|
|00005070| 20 74 68 61 74 20 63 6f | 76 65 72 73 20 74 68 65 | that co|vers the|
|00005080| 20 70 61 73 74 65 62 6f | 61 72 64 2e 0d 00 f0 64 | pastebo|ard....d|
|00005090| 00 1c 1b 00 2a a6 00 02 | 86 00 00 a7 00 1b f8 01 |....*...|........|
|000050a0| 87 24 00 1e e9 00 a8 64 | 00 23 3a 01 42 64 00 26 |.$.....d|.#:.Bd.&|
|000050b0| 91 00 a8 64 00 02 e7 00 | e1 64 00 28 a2 01 17 64 |...d....|.d.(...d|
|000050c0| 00 2e af 00 b6 74 00 31 | 66 02 01 64 00 34 d1 01 |.....t.1|f..d.4..|
|000050d0| 96 64 00 06 6d 00 d3 1c | 00 04 3e 00 0e 0d 00 04 |.d..m...|..>.....|
|000050e0| 41 01 47 6c 00 07 df 00 | d2 6c 00 04 65 00 70 64 |A.Gl....|.l..e.pd|
|000050f0| 00 0a 61 02 3e 4c 00 0e | 59 00 70 0d 00 0e 71 00 |..a.>L..|Y.p...q.|
|00005100| e7 64 00 38 02 01 18 0c | 00 0e 90 00 1c 74 00 0e |.d.8....|.....t..|
|00005110| 94 01 dd 74 00 14 b5 00 | fc 64 00 17 40 00 7f 74 |...t....|.d..@..t|
|00005120| 00 11 7e 02 4d 5c 00 18 | f7 00 2a 4d 00 11 4b 01 |..~.M\..|..*M..K.|
|00005130| 12 64 00 3c 6f 01 5e 64 | 00 19 83 01 96 4d 00 19 |.d.<o.^d|.....M..|
|00005140| 59 00 dc 64 00 3f f6 00 | 9a 04 00 42 e6 00 62 64 |Y..d.?..|...B..bd|
|00005150| 00 44 e6 01 50 74 00 46 | bd 01 42 64 00 49 95 00 |.D..Pt.F|..Bd.I..|
|00005160| ef 0d 00 1b d7 01 3c 64 | 00 4b ff 00 1d 4d 00 4c |......<d|.K...M.L|
|00005170| 35 01 20 64 00 4c 64 00 | b8 0c 00 4f c4 00 38 00 |5. d.Ld.|...O..8.|
|00005180| 18 04 00 02 00 00 38 04 | 00 02 06 00 38 24 00 02 |......8.|....8$..|
|00005190| 86 00 38 04 00 1b f8 00 | 2a 00 00 00 06 00 08 00 |..8.....|*.......|
|000051a0| 00 00 01 00 6d 0d ff 00 | 15 0a 00 f7 4f 62 6a 65 |....m...|....Obje|
|000051b0| 63 74 20 42 61 73 65 64 | 20 43 6f 6d 70 75 74 69 |ct Based| Computi|
|000051c0| 6e 67 3a 20 41 20 4e 65 | 58 54 73 74 65 70 20 54 |ng: A Ne|XTstep T|
|000051d0| 75 74 6f 72 69 61 6c 20 | 61 6e 64 20 43 6f 6f 6b |utorial |and Cook|
|000051e0| 62 6f 6f 6b 20 2d 20 56 | 65 72 73 69 6f 6e 20 31 |book - V|ersion 1|
|000051f0| 2e 35 20 2d 20 44 47 4d | 0d 43 68 61 70 74 65 72 |.5 - DGM|.Chapter|
|00005200| 20 39 3a 20 4d 6f 72 65 | 20 44 72 61 77 69 6e 67 | 9: More| Drawing|
|00005210| 0d 0d 02 cb fc 00 48 02 | 0a 00 48 00 0e 01 b0 06 |......H.|..H.....|
|00005220| 30 f7 ff 00 15 24 00 f7 | f5 f6 ff 00 15 24 01 f7 |0....$..|.....$..|
|00005230| 43 68 61 70 74 65 72 20 | 39 0d 4d 6f 72 65 20 44 |Chapter |9.More D|
|00005240| 72 61 77 69 6e 67 ff 00 | 15 0c 00 f7 0d fc 00 5a |rawing..|.......Z|
|00005250| 02 0a 00 5a 00 0e 01 b0 | 06 30 f7 0d 0d 0d 0d 0d |...Z....|.0......|
|00005260| 0d 0d 0d 0d ff 00 15 0c | 02 f7 0d 0d ff 00 15 24 |........|.......$|
|00005270| 01 f7 0d ff 00 15 18 01 | f7 ff 00 15 0c 02 f7 0d |........|........|
|00005280| fc 00 90 01 e6 00 90 00 | 0e 02 b0 06 30 f7 50 75 |........|....0.Pu|
|00005290| 74 20 61 20 71 75 69 74 | 65 20 68 65 72 65 2e 0d |t a quit|e here..|
|000052a0| 20 20 20 20 2d 20 41 75 | 74 68 6f 72 0d 31 32 20 | - Au|thor.12 |
|000052b0| 70 74 20 68 65 6c 76 65 | 74 69 63 61 20 69 74 61 |pt helve|tica ita|
|000052c0| 6c 69 63 73 20 32 20 69 | 6e 63 68 20 6d 61 72 67 |lics 2 i|nch marg|
|000052d0| 69 6e ff 00 15 0c 00 f7 | 0d fc 00 7e 01 e6 00 7e |in......|...~...~|
|000052e0| 00 0e 02 b0 06 30 f7 0d | fc 00 6c 02 0a 00 6c 00 |.....0..|..l...l.|
|000052f0| 0e 02 44 06 30 f7 ff 00 | 15 0a 00 f7 49 6e 20 74 |..D.0...|....In t|
|00005300| 68 65 20 6c 61 73 74 20 | 63 68 61 70 74 65 72 20 |he last |chapter |
|00005310| 77 65 20 69 6e 74 72 6f | 64 75 63 65 64 20 73 6f |we intro|duced so|
|00005320| 6d 65 20 73 69 6d 70 6c | 65 20 64 72 61 77 69 6e |me simpl|e drawin|
|00005330| 67 20 63 6f 6d 6d 61 6e | 64 73 ff 00 15 0a 00 f7 |g comman|ds......|
|00005340| 20 61 6e 64 20 68 6f 77 | 20 74 6f 20 69 6e 74 65 | and how| to inte|
|00005350| 67 72 61 74 65 20 74 68 | 65 6d 20 69 6e 74 6f 20 |grate th|em into |
|00005360| 61 6e 20 6f 62 6a 65 63 | 74 2e 20 20 4e 6f 77 20 |an objec|t. Now |
|00005370| 77 65 20 77 69 6c 6c 20 | 6c 6f 6f 6b 20 61 74 20 |we will |look at |
|00005380| 74 77 6f 20 61 64 64 69 | 74 69 6f 6e 61 6c 20 74 |two addi|tional t|
|00005390| 6f 70 69 63 73 3a 20 69 | 6e 69 74 69 61 6c 69 7a |opics: i|nitializ|
|000053a0| 69 6e 67 20 74 68 65 20 | 73 74 61 74 65 73 20 6f |ing the |states o|
|000053b0| 66 20 6f 62 6a 65 63 74 | 73 20 74 68 61 74 20 61 |f object|s that a|
|000053c0| 72 65 20 61 20 73 75 62 | 2d 63 6c 61 73 73 20 6f |re a sub|-class o|
|000053d0| 66 20 74 68 65 20 56 69 | 65 77 20 63 6c 61 73 73 |f the Vi|ew class|
|000053e0| 20 61 6e 64 20 68 6f 77 | 20 74 6f 20 74 61 6b 65 | and how| to take|
|000053f0| 20 61 20 66 69 6c 65 20 | 6f 66 20 70 75 72 65 20 | a file |of pure |
|00005400| 50 6f 73 74 53 63 72 69 | 70 74 20 63 6f 6d 6d 61 |PostScri|pt comma|
|00005410| 6e 64 73 20 61 6e 64 20 | 75 73 65 20 74 68 61 74 |nds and |use that|
|00005420| 20 64 72 61 77 20 61 6e | 20 6f 62 6a 65 63 74 2e | draw an| object.|
|00005430| 20 20 4f 6e 63 65 20 77 | 65 20 68 61 76 65 20 74 | Once w|e have t|
|00005440| 68 65 73 65 20 74 77 6f | 20 74 6f 70 69 63 73 20 |hese two| topics |
|00005450| 75 6e 64 65 72 20 6f 75 | 72 20 62 65 6c 74 20 77 |under ou|r belt w|
|00005460| 65 20 77 69 6c 6c 20 62 | 65 20 61 62 6c 65 20 74 |e will b|e able t|
|00005470| 6f 20 64 6f 20 73 6f 6d | 65 20 72 65 61 6c 6c 79 |o do som|e really|
|00005480| 20 65 78 63 69 74 69 6e | 67 20 70 72 6f 67 72 61 | excitin|g progra|
|00005490| 6d 73 2e 0d 0d fc 00 48 | 02 0a 00 48 00 0e 02 44 |ms.....H|...H...D|
|000054a0| 06 30 f7 ff 00 15 18 01 | f7 f9 00 f7 49 6e 69 74 |.0......|....Init|
|000054b0| 69 61 6c 69 7a 69 6e 67 | 20 56 69 65 77 73 3a 20 |ializing| Views: |
|000054c0| 6e 65 77 46 72 61 6d 65 | 3a 0d fc 00 6c 02 0a 00 |newFrame|:...l...|
|000054d0| 6c 00 0e 02 44 06 30 f7 | ff 00 15 0a 00 f7 0d 00 |l...D.0.|........|
|000054e0| f0 64 00 52 12 00 2a a6 | 00 51 a3 00 00 a7 00 1b |.d.R..*.|.Q......|
|000054f0| f8 01 b1 24 00 1e e9 00 | a8 64 00 23 3a 01 42 64 |...$....|.d.#:.Bd|
|00005500| 00 26 91 00 a8 64 00 02 | e7 00 e1 64 00 28 a2 01 |.&...d..|...d.(..|
|00005510| 17 64 00 2e af 00 b6 74 | 00 31 66 02 01 64 00 34 |.d.....t|.1f..d.4|
|00005520| d1 01 96 64 00 06 6d 00 | d3 1c 00 04 3e 00 0e 0d |...d..m.|....>...|
|00005530| 00 04 41 01 47 6c 00 07 | df 00 d2 6c 00 04 65 00 |..A.Gl..|...l..e.|
|00005540| 70 64 00 0a 61 02 3e 4c | 00 0e 59 00 70 0d 00 0e |pd..a.>L|..Y.p...|
|00005550| 71 00 e7 64 00 38 02 01 | 18 0c 00 0e 90 00 1c 74 |q..d.8..|.......t|
|00005560| 00 0e 94 01 dd 74 00 14 | b5 00 fc 64 00 17 40 00 |.....t..|...d..@.|
|00005570| 7f 74 00 11 7e 02 4d 5c | 00 18 f7 00 2a 4d 00 11 |.t..~.M\|....*M..|
|00005580| 4b 01 12 64 00 3c 6f 01 | 5e 64 00 19 83 01 96 4d |K..d.<o.|^d.....M|
|00005590| 00 19 59 00 dc 64 00 3f | f6 00 9a 04 00 42 e6 00 |..Y..d.?|.....B..|
|000055a0| 62 64 00 44 e6 01 50 74 | 00 46 bd 01 42 64 00 49 |bd.D..Pt|.F..Bd.I|
|000055b0| 95 00 ef 0d 00 1b d7 01 | 3c 64 00 4b ff 00 1d 4d |........|<d.K...M|
|000055c0| 00 4c 35 01 20 64 00 4c | 64 00 b8 0c 00 4f c4 00 |.L5. d.L|d....O..|
|000055d0| 38 00 18 04 00 02 00 00 | 38 04 00 02 06 00 38 24 |8.......|8.....8$|
|000055e0| 00 51 a3 00 38 04 00 1b | f8 00 2a |.Q..8...|..* |
+--------+-------------------------+-------------------------+--------+--------+