home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 53 74 61 6e 64 61 72 |\chapter|{Standar|
|00000010| 64 20 57 69 6e 64 6f 77 | 69 6e 67 20 49 6e 74 65 |d Window|ing Inte|
|00000020| 72 66 61 63 65 7d 0a 0a | 54 68 65 20 6d 6f 64 75 |rface}..|The modu|
|00000030| 6c 65 73 20 69 6e 20 74 | 68 69 73 20 63 68 61 70 |les in t|his chap|
|00000040| 74 65 72 20 61 72 65 20 | 61 76 61 69 6c 61 62 6c |ter are |availabl|
|00000050| 65 20 6f 6e 6c 79 20 6f | 6e 20 74 68 6f 73 65 20 |e only o|n those |
|00000060| 73 79 73 74 65 6d 73 20 | 77 68 65 72 65 0a 74 68 |systems |where.th|
|00000070| 65 20 53 54 44 57 49 4e | 20 6c 69 62 72 61 72 79 |e STDWIN| library|
|00000080| 20 69 73 20 61 76 61 69 | 6c 61 62 6c 65 2e 20 20 | is avai|lable. |
|00000090| 53 54 44 57 49 4e 20 72 | 75 6e 73 20 6f 6e 20 5c |STDWIN r|uns on \|
|000000a0| 55 4e 49 58 7b 7d 20 75 | 6e 64 65 72 20 58 31 31 |UNIX{} u|nder X11|
|000000b0| 20 61 6e 64 0a 6f 6e 20 | 74 68 65 20 4d 61 63 69 | and.on |the Maci|
|000000c0| 6e 74 6f 73 68 2e 20 20 | 53 65 65 20 43 57 49 20 |ntosh. |See CWI |
|000000d0| 72 65 70 6f 72 74 20 43 | 53 2d 52 38 38 31 37 2e |report C|S-R8817.|
|000000e0| 0a 0a 5c 73 74 72 6f 6e | 67 7b 57 61 72 6e 69 6e |..\stron|g{Warnin|
|000000f0| 67 3a 7d 20 55 73 69 6e | 67 20 53 54 44 57 49 4e |g:} Usin|g STDWIN|
|00000100| 20 69 73 20 6e 6f 74 20 | 72 65 63 6f 6d 6d 65 6e | is not |recommen|
|00000110| 64 65 64 20 66 6f 72 20 | 6e 65 77 0a 61 70 70 6c |ded for |new.appl|
|00000120| 69 63 61 74 69 6f 6e 73 | 2e 20 20 49 74 20 68 61 |ications|. It ha|
|00000130| 73 20 6e 65 76 65 72 20 | 62 65 65 6e 20 70 6f 72 |s never |been por|
|00000140| 74 65 64 20 74 6f 20 4d | 69 63 72 6f 73 6f 66 74 |ted to M|icrosoft|
|00000150| 20 57 69 6e 64 6f 77 73 | 20 6f 72 0a 57 69 6e 64 | Windows| or.Wind|
|00000160| 6f 77 73 20 4e 54 2c 20 | 61 6e 64 20 66 6f 72 20 |ows NT, |and for |
|00000170| 58 31 31 20 6f 72 20 74 | 68 65 20 4d 61 63 69 6e |X11 or t|he Macin|
|00000180| 74 6f 73 68 20 69 74 20 | 6c 61 63 6b 73 20 69 6d |tosh it |lacks im|
|00000190| 70 6f 72 74 61 6e 74 0a | 66 75 6e 63 74 69 6f 6e |portant.|function|
|000001a0| 61 6c 69 74 79 20 2d 2d | 2d 20 69 6e 20 70 61 72 |ality --|- in par|
|000001b0| 74 69 63 75 6c 61 72 2c | 20 69 74 20 68 61 73 20 |ticular,| it has |
|000001c0| 6e 6f 20 74 6f 6f 6c 73 | 20 66 6f 72 20 74 68 65 |no tools| for the|
|000001d0| 20 63 6f 6e 73 74 72 75 | 63 74 69 6f 6e 0a 6f 66 | constru|ction.of|
|000001e0| 20 64 69 61 6c 6f 67 73 | 2e 20 20 46 6f 72 20 6d | dialogs|. For m|
|000001f0| 6f 73 74 20 70 6c 61 74 | 66 6f 72 6d 73 2c 20 61 |ost plat|forms, a|
|00000200| 6c 74 65 72 6e 61 74 69 | 76 65 2c 20 6e 61 74 69 |lternati|ve, nati|
|00000210| 76 65 20 73 6f 6c 75 74 | 69 6f 6e 73 20 65 78 69 |ve solut|ions exi|
|00000220| 73 74 0a 28 74 68 6f 75 | 67 68 20 6e 6f 6e 65 20 |st.(thou|gh none |
|00000230| 61 72 65 20 63 75 72 72 | 65 6e 74 6c 79 20 64 6f |are curr|ently do|
|00000240| 63 75 6d 65 6e 74 65 64 | 20 69 6e 20 74 68 69 73 |cumented| in this|
|00000250| 20 6d 61 6e 75 61 6c 29 | 3a 20 54 6b 69 6e 74 65 | manual)|: Tkinte|
|00000260| 72 20 66 6f 72 0a 5c 55 | 4e 49 58 7b 7d 20 75 6e |r for.\U|NIX{} un|
|00000270| 64 65 72 20 58 31 31 2c | 20 6e 61 74 69 76 65 20 |der X11,| native |
|00000280| 58 74 20 77 69 74 68 20 | 4d 6f 74 69 66 20 6f 72 |Xt with |Motif or|
|00000290| 20 41 74 68 65 6e 61 20 | 77 69 64 67 65 74 73 20 | Athena |widgets |
|000002a0| 66 6f 72 20 5c 55 4e 49 | 58 7b 7d 0a 75 6e 64 65 |for \UNI|X{}.unde|
|000002b0| 72 20 58 31 31 2c 20 57 | 69 6e 33 32 20 66 6f 72 |r X11, W|in32 for|
|000002c0| 20 57 69 6e 64 6f 77 73 | 20 61 6e 64 20 57 69 6e | Windows| and Win|
|000002d0| 64 6f 77 73 20 4e 54 2c | 20 61 6e 64 20 61 20 63 |dows NT,| and a c|
|000002e0| 6f 6c 6c 65 63 74 69 6f | 6e 20 6f 66 0a 6e 61 74 |ollectio|n of.nat|
|000002f0| 69 76 65 20 74 6f 6f 6c | 6b 69 74 20 69 6e 74 65 |ive tool|kit inte|
|00000300| 72 66 61 63 65 73 20 66 | 6f 72 20 74 68 65 20 4d |rfaces f|or the M|
|00000310| 61 63 69 6e 74 6f 73 68 | 2e 0a 0a 5c 73 65 63 74 |acintosh|...\sect|
|00000320| 69 6f 6e 7b 42 75 69 6c | 74 2d 69 6e 20 4d 6f 64 |ion{Buil|t-in Mod|
|00000330| 75 6c 65 20 5c 73 65 63 | 74 63 6f 64 65 7b 73 74 |ule \sec|tcode{st|
|00000340| 64 77 69 6e 7d 7d 0a 5c | 62 69 6d 6f 64 69 6e 64 |dwin}}.\|bimodind|
|00000350| 65 78 7b 73 74 64 77 69 | 6e 7d 0a 0a 54 68 69 73 |ex{stdwi|n}..This|
|00000360| 20 6d 6f 64 75 6c 65 20 | 64 65 66 69 6e 65 73 20 | module |defines |
|00000370| 73 65 76 65 72 61 6c 20 | 6e 65 77 20 6f 62 6a 65 |several |new obje|
|00000380| 63 74 20 74 79 70 65 73 | 20 61 6e 64 20 66 75 6e |ct types| and fun|
|00000390| 63 74 69 6f 6e 73 20 74 | 68 61 74 0a 70 72 6f 76 |ctions t|hat.prov|
|000003a0| 69 64 65 20 61 63 63 65 | 73 73 20 74 6f 20 74 68 |ide acce|ss to th|
|000003b0| 65 20 66 75 6e 63 74 69 | 6f 6e 61 6c 69 74 79 20 |e functi|onality |
|000003c0| 6f 66 20 53 54 44 57 49 | 4e 2e 0a 0a 4f 6e 20 55 |of STDWI|N...On U|
|000003d0| 6e 69 78 20 72 75 6e 6e | 69 6e 67 20 58 31 31 2c |nix runn|ing X11,|
|000003e0| 20 69 74 20 63 61 6e 20 | 6f 6e 6c 79 20 62 65 20 | it can |only be |
|000003f0| 75 73 65 64 20 69 66 20 | 74 68 65 20 5c 63 6f 64 |used if |the \cod|
|00000400| 65 7b 44 49 53 50 4c 41 | 59 7d 0a 65 6e 76 69 72 |e{DISPLA|Y}.envir|
|00000410| 6f 6e 6d 65 6e 74 20 76 | 61 72 69 61 62 6c 65 20 |onment v|ariable |
|00000420| 69 73 20 73 65 74 20 6f | 72 20 61 6e 20 65 78 70 |is set o|r an exp|
|00000430| 6c 69 63 69 74 20 5c 73 | 61 6d 70 7b 2d 64 69 73 |licit \s|amp{-dis|
|00000440| 70 6c 61 79 0a 5c 76 61 | 72 7b 64 69 73 70 6c 61 |play.\va|r{displa|
|00000450| 79 6e 61 6d 65 7d 7d 20 | 61 72 67 75 6d 65 6e 74 |yname}} |argument|
|00000460| 20 69 73 20 70 61 73 73 | 65 64 20 74 6f 20 74 68 | is pass|ed to th|
|00000470| 65 20 50 79 74 68 6f 6e | 20 69 6e 74 65 72 70 72 |e Python| interpr|
|00000480| 65 74 65 72 2e 0a 0a 46 | 75 6e 63 74 69 6f 6e 73 |eter...F|unctions|
|00000490| 20 68 61 76 65 20 6e 61 | 6d 65 73 20 74 68 61 74 | have na|mes that|
|000004a0| 20 75 73 75 61 6c 6c 79 | 20 72 65 73 65 6d 62 6c | usually| resembl|
|000004b0| 65 20 74 68 65 69 72 20 | 43 20 53 54 44 57 49 4e |e their |C STDWIN|
|000004c0| 20 63 6f 75 6e 74 65 72 | 70 61 72 74 73 0a 77 69 | counter|parts.wi|
|000004d0| 74 68 20 74 68 65 20 69 | 6e 69 74 69 61 6c 20 60 |th the i|nitial `|
|000004e0| 77 27 20 64 72 6f 70 70 | 65 64 2e 0a 50 6f 69 6e |w' dropp|ed..Poin|
|000004f0| 74 73 20 61 72 65 20 72 | 65 70 72 65 73 65 6e 74 |ts are r|epresent|
|00000500| 65 64 20 62 79 20 70 61 | 69 72 73 20 6f 66 20 69 |ed by pa|irs of i|
|00000510| 6e 74 65 67 65 72 73 3b | 20 72 65 63 74 61 6e 67 |ntegers;| rectang|
|00000520| 6c 65 73 0a 62 79 20 70 | 61 69 72 73 20 6f 66 20 |les.by p|airs of |
|00000530| 70 6f 69 6e 74 73 2e 0a | 46 6f 72 20 61 20 63 6f |points..|For a co|
|00000540| 6d 70 6c 65 74 65 20 64 | 65 73 63 72 69 70 74 69 |mplete d|escripti|
|00000550| 6f 6e 20 6f 66 20 53 54 | 44 57 49 4e 20 70 6c 65 |on of ST|DWIN ple|
|00000560| 61 73 65 20 72 65 66 65 | 72 20 74 6f 20 74 68 65 |ase refe|r to the|
|00000570| 20 64 6f 63 75 6d 65 6e | 74 61 74 69 6f 6e 0a 6f | documen|tation.o|
|00000580| 66 20 53 54 44 57 49 4e | 20 66 6f 72 20 43 20 70 |f STDWIN| for C p|
|00000590| 72 6f 67 72 61 6d 6d 65 | 72 73 20 28 61 66 6f 72 |rogramme|rs (afor|
|000005a0| 65 6d 65 6e 74 69 6f 6e | 65 64 20 43 57 49 20 72 |emention|ed CWI r|
|000005b0| 65 70 6f 72 74 29 2e 0a | 0a 5c 73 75 62 73 65 63 |eport)..|.\subsec|
|000005c0| 74 69 6f 6e 7b 46 75 6e | 63 74 69 6f 6e 73 20 44 |tion{Fun|ctions D|
|000005d0| 65 66 69 6e 65 64 20 69 | 6e 20 4d 6f 64 75 6c 65 |efined i|n Module|
|000005e0| 20 5c 73 65 63 74 63 6f | 64 65 7b 73 74 64 77 69 | \sectco|de{stdwi|
|000005f0| 6e 7d 7d 0a 5c 6e 6f 64 | 65 6e 61 6d 65 7b 53 54 |n}}.\nod|ename{ST|
|00000600| 44 57 49 4e 20 46 75 6e | 63 74 69 6f 6e 73 7d 0a |DWIN Fun|ctions}.|
|00000610| 0a 54 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 66 |.The fol|lowing f|
|00000620| 75 6e 63 74 69 6f 6e 73 | 20 61 72 65 20 64 65 66 |unctions| are def|
|00000630| 69 6e 65 64 20 69 6e 20 | 74 68 65 20 5c 63 6f 64 |ined in |the \cod|
|00000640| 65 7b 73 74 64 77 69 6e | 7d 20 6d 6f 64 75 6c 65 |e{stdwin|} module|
|00000650| 3a 0a 0a 5c 72 65 6e 65 | 77 63 6f 6d 6d 61 6e 64 |:..\rene|wcommand|
|00000660| 7b 5c 69 6e 64 65 78 73 | 75 62 69 74 65 6d 7d 7b |{\indexs|ubitem}{|
|00000670| 28 69 6e 20 6d 6f 64 75 | 6c 65 20 73 74 64 77 69 |(in modu|le stdwi|
|00000680| 6e 29 7d 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |n)}.\beg|in{funcd|
|00000690| 65 73 63 7d 7b 6f 70 65 | 6e 7d 7b 74 69 74 6c 65 |esc}{ope|n}{title|
|000006a0| 7d 0a 4f 70 65 6e 20 61 | 20 6e 65 77 20 77 69 6e |}.Open a| new win|
|000006b0| 64 6f 77 20 77 68 6f 73 | 65 20 69 6e 69 74 69 61 |dow whos|e initia|
|000006c0| 6c 20 74 69 74 6c 65 20 | 69 73 20 67 69 76 65 6e |l title |is given|
|000006d0| 20 62 79 20 74 68 65 20 | 73 74 72 69 6e 67 20 61 | by the |string a|
|000006e0| 72 67 75 6d 65 6e 74 2e | 0a 52 65 74 75 72 6e 20 |rgument.|.Return |
|000006f0| 61 20 77 69 6e 64 6f 77 | 20 6f 62 6a 65 63 74 3b |a window| object;|
|00000700| 20 77 69 6e 64 6f 77 20 | 6f 62 6a 65 63 74 20 6d | window |object m|
|00000710| 65 74 68 6f 64 73 20 61 | 72 65 20 64 65 73 63 72 |ethods a|re descr|
|00000720| 69 62 65 64 20 62 65 6c | 6f 77 2e 25 0a 5c 66 6f |ibed bel|ow.%.\fo|
|00000730| 6f 74 6e 6f 74 65 7b 54 | 68 65 20 50 79 74 68 6f |otnote{T|he Pytho|
|00000740| 6e 20 76 65 72 73 69 6f | 6e 20 6f 66 20 53 54 44 |n versio|n of STD|
|00000750| 57 49 4e 20 64 6f 65 73 | 20 6e 6f 74 20 73 75 70 |WIN does| not sup|
|00000760| 70 6f 72 74 20 64 72 61 | 77 20 70 72 6f 63 65 64 |port dra|w proced|
|00000770| 75 72 65 73 3b 20 61 6c | 6c 0a 09 64 72 61 77 69 |ures; al|l..drawi|
|00000780| 6e 67 20 72 65 71 75 65 | 73 74 73 20 61 72 65 20 |ng reque|sts are |
|00000790| 72 65 70 6f 72 74 65 64 | 20 61 73 20 64 72 61 77 |reported| as draw|
|000007a0| 20 65 76 65 6e 74 73 2e | 7d 0a 5c 65 6e 64 7b 66 | events.|}.\end{f|
|000007b0| 75 6e 63 64 65 73 63 7d | 0a 0a 5c 62 65 67 69 6e |uncdesc}|..\begin|
|000007c0| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 67 65 74 65 76 |{funcdes|c}{getev|
|000007d0| 65 6e 74 7d 7b 7d 0a 57 | 61 69 74 20 66 6f 72 20 |ent}{}.W|ait for |
|000007e0| 61 6e 64 20 72 65 74 75 | 72 6e 20 74 68 65 20 6e |and retu|rn the n|
|000007f0| 65 78 74 20 65 76 65 6e | 74 2e 0a 41 6e 20 65 76 |ext even|t..An ev|
|00000800| 65 6e 74 20 69 73 20 72 | 65 74 75 72 6e 65 64 20 |ent is r|eturned |
|00000810| 61 73 20 61 20 74 72 69 | 70 6c 65 3a 20 74 68 65 |as a tri|ple: the|
|00000820| 20 66 69 72 73 74 20 65 | 6c 65 6d 65 6e 74 20 69 | first e|lement i|
|00000830| 73 20 74 68 65 20 65 76 | 65 6e 74 0a 74 79 70 65 |s the ev|ent.type|
|00000840| 2c 20 61 20 73 6d 61 6c | 6c 20 69 6e 74 65 67 65 |, a smal|l intege|
|00000850| 72 3b 20 74 68 65 20 73 | 65 63 6f 6e 64 20 65 6c |r; the s|econd el|
|00000860| 65 6d 65 6e 74 20 69 73 | 20 74 68 65 20 77 69 6e |ement is| the win|
|00000870| 64 6f 77 20 6f 62 6a 65 | 63 74 20 74 6f 20 77 68 |dow obje|ct to wh|
|00000880| 69 63 68 0a 74 68 65 20 | 65 76 65 6e 74 20 61 70 |ich.the |event ap|
|00000890| 70 6c 69 65 73 2c 20 6f | 72 0a 5c 63 6f 64 65 7b |plies, o|r.\code{|
|000008a0| 4e 6f 6e 65 7d 0a 69 66 | 20 69 74 20 61 70 70 6c |None}.if| it appl|
|000008b0| 69 65 73 20 74 6f 20 6e | 6f 20 77 69 6e 64 6f 77 |ies to n|o window|
|000008c0| 20 69 6e 20 70 61 72 74 | 69 63 75 6c 61 72 3b 0a | in part|icular;.|
|000008d0| 74 68 65 20 74 68 69 72 | 64 20 65 6c 65 6d 65 6e |the thir|d elemen|
|000008e0| 74 20 69 73 20 74 79 70 | 65 2d 64 65 70 65 6e 64 |t is typ|e-depend|
|000008f0| 65 6e 74 2e 0a 4e 61 6d | 65 73 20 66 6f 72 20 65 |ent..Nam|es for e|
|00000900| 76 65 6e 74 20 74 79 70 | 65 73 20 61 6e 64 20 63 |vent typ|es and c|
|00000910| 6f 6d 6d 61 6e 64 20 63 | 6f 64 65 73 20 61 72 65 |ommand c|odes are|
|00000920| 20 64 65 66 69 6e 65 64 | 20 69 6e 20 74 68 65 20 | defined| in the |
|00000930| 73 74 61 6e 64 61 72 64 | 0a 6d 6f 64 75 6c 65 0a |standard|.module.|
|00000940| 5c 63 6f 64 65 7b 73 74 | 64 77 69 6e 65 76 65 6e |\code{st|dwineven|
|00000950| 74 7d 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |t}..\end|{funcdes|
|00000960| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00000970| 65 73 63 7d 7b 70 6f 6c | 6c 65 76 65 6e 74 7d 7b |esc}{pol|levent}{|
|00000980| 7d 0a 52 65 74 75 72 6e | 20 74 68 65 20 6e 65 78 |}.Return| the nex|
|00000990| 74 20 65 76 65 6e 74 2c | 20 69 66 20 6f 6e 65 20 |t event,| if one |
|000009a0| 69 73 20 69 6d 6d 65 64 | 69 61 74 65 6c 79 20 61 |is immed|iately a|
|000009b0| 76 61 69 6c 61 62 6c 65 | 2e 0a 49 66 20 6e 6f 20 |vailable|..If no |
|000009c0| 65 76 65 6e 74 20 69 73 | 20 61 76 61 69 6c 61 62 |event is| availab|
|000009d0| 6c 65 2c 20 72 65 74 75 | 72 6e 20 5c 63 6f 64 65 |le, retu|rn \code|
|000009e0| 7b 28 29 7d 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |{()}..\e|nd{funcd|
|000009f0| 65 73 63 7d 0a 0a 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00000a00| 63 64 65 73 63 7d 7b 67 | 65 74 61 63 74 69 76 65 |cdesc}{g|etactive|
|00000a10| 7d 7b 7d 0a 52 65 74 75 | 72 6e 20 74 68 65 20 77 |}{}.Retu|rn the w|
|00000a20| 69 6e 64 6f 77 20 74 68 | 61 74 20 69 73 20 63 75 |indow th|at is cu|
|00000a30| 72 72 65 6e 74 6c 79 20 | 61 63 74 69 76 65 2c 20 |rrently |active, |
|00000a40| 6f 72 20 5c 63 6f 64 65 | 7b 4e 6f 6e 65 7d 20 69 |or \code|{None} i|
|00000a50| 66 20 6e 6f 0a 77 69 6e | 64 6f 77 20 69 73 20 63 |f no.win|dow is c|
|00000a60| 75 72 72 65 6e 74 6c 79 | 20 61 63 74 69 76 65 2e |urrently| active.|
|00000a70| 20 20 28 54 68 69 73 20 | 63 61 6e 20 62 65 20 65 | (This |can be e|
|00000a80| 6d 75 6c 61 74 65 64 20 | 62 79 20 6d 6f 6e 69 74 |mulated |by monit|
|00000a90| 6f 72 69 6e 67 0a 57 45 | 5f 41 43 54 49 56 41 54 |oring.WE|_ACTIVAT|
|00000aa0| 45 20 61 6e 64 20 57 45 | 5f 44 45 41 43 54 49 56 |E and WE|_DEACTIV|
|00000ab0| 41 54 45 20 65 76 65 6e | 74 73 2e 29 0a 5c 65 6e |ATE even|ts.).\en|
|00000ac0| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0a 0a 5c 62 65 |d{funcde|sc}..\be|
|00000ad0| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 6c 69 |gin{func|desc}{li|
|00000ae0| 73 74 66 6f 6e 74 6e 61 | 6d 65 73 7d 7b 70 61 74 |stfontna|mes}{pat|
|00000af0| 74 65 72 6e 7d 0a 52 65 | 74 75 72 6e 20 74 68 65 |tern}.Re|turn the|
|00000b00| 20 6c 69 73 74 20 6f 66 | 20 66 6f 6e 74 20 6e 61 | list of| font na|
|00000b10| 6d 65 73 20 69 6e 20 74 | 68 65 20 73 79 73 74 65 |mes in t|he syste|
|00000b20| 6d 20 74 68 61 74 20 6d | 61 74 63 68 20 74 68 65 |m that m|atch the|
|00000b30| 20 70 61 74 74 65 72 6e | 20 28 61 0a 73 74 72 69 | pattern| (a.stri|
|00000b40| 6e 67 29 2e 20 20 54 68 | 65 20 70 61 74 74 65 72 |ng). Th|e patter|
|00000b50| 6e 20 73 68 6f 75 6c 64 | 20 6e 6f 72 6d 61 6c 6c |n should| normall|
|00000b60| 79 20 62 65 20 5c 63 6f | 64 65 7b 27 2a 27 7d 3b |y be \co|de{'*'};|
|00000b70| 20 72 65 74 75 72 6e 73 | 20 61 6c 6c 0a 61 76 61 | returns| all.ava|
|00000b80| 69 6c 61 62 6c 65 20 66 | 6f 6e 74 73 2e 20 20 49 |ilable f|onts. I|
|00000b90| 66 20 74 68 65 20 75 6e | 64 65 72 6c 79 69 6e 67 |f the un|derlying|
|00000ba0| 20 77 69 6e 64 6f 77 20 | 73 79 73 74 65 6d 20 69 | window |system i|
|00000bb0| 73 20 58 31 31 2c 20 6f | 74 68 65 72 0a 70 61 74 |s X11, o|ther.pat|
|00000bc0| 74 65 72 6e 73 20 66 6f | 6c 6c 6f 77 20 74 68 65 |terns fo|llow the|
|00000bd0| 20 73 74 61 6e 64 61 72 | 64 20 58 31 31 20 66 6f | standar|d X11 fo|
|00000be0| 6e 74 20 73 65 6c 65 63 | 74 69 6f 6e 20 73 79 6e |nt selec|tion syn|
|00000bf0| 74 61 78 20 28 61 73 20 | 75 73 65 64 20 65 2e 67 |tax (as |used e.g|
|00000c00| 2e 0a 69 6e 20 72 65 73 | 6f 75 72 63 65 20 64 65 |..in res|ource de|
|00000c10| 66 69 6e 69 74 69 6f 6e | 73 29 2c 20 69 2e 65 2e |finition|s), i.e.|
|00000c20| 20 74 68 65 20 77 69 6c | 64 63 61 72 64 20 63 68 | the wil|dcard ch|
|00000c30| 61 72 61 63 74 65 72 20 | 5c 63 6f 64 65 7b 27 2a |aracter |\code{'*|
|00000c40| 27 7d 0a 6d 61 74 63 68 | 65 73 20 61 6e 79 20 73 |'}.match|es any s|
|00000c50| 65 71 75 65 6e 63 65 20 | 6f 66 20 63 68 61 72 61 |equence |of chara|
|00000c60| 63 74 65 72 73 20 28 69 | 6e 63 6c 75 64 69 6e 67 |cters (i|ncluding|
|00000c70| 20 6e 6f 6e 65 29 20 61 | 6e 64 20 5c 63 6f 64 65 | none) a|nd \code|
|00000c80| 7b 27 3f 27 7d 0a 6d 61 | 74 63 68 65 73 20 61 6e |{'?'}.ma|tches an|
|00000c90| 79 20 73 69 6e 67 6c 65 | 20 63 68 61 72 61 63 74 |y single| charact|
|00000ca0| 65 72 2e 0a 4f 6e 20 74 | 68 65 20 4d 61 63 69 6e |er..On t|he Macin|
|00000cb0| 74 6f 73 68 20 74 68 69 | 73 20 66 75 6e 63 74 69 |tosh thi|s functi|
|00000cc0| 6f 6e 20 63 75 72 72 65 | 6e 74 6c 79 20 72 65 74 |on curre|ntly ret|
|00000cd0| 75 72 6e 73 20 61 6e 20 | 65 6d 70 74 79 20 6c 69 |urns an |empty li|
|00000ce0| 73 74 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |st..\end|{funcdes|
|00000cf0| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00000d00| 65 73 63 7d 7b 73 65 74 | 64 65 66 73 63 72 6f 6c |esc}{set|defscrol|
|00000d10| 6c 62 61 72 73 7d 7b 68 | 66 6c 61 67 5c 2c 20 76 |lbars}{h|flag\, v|
|00000d20| 66 6c 61 67 7d 0a 53 65 | 74 20 74 68 65 20 66 6c |flag}.Se|t the fl|
|00000d30| 61 67 73 20 63 6f 6e 74 | 72 6f 6c 6c 69 6e 67 20 |ags cont|rolling |
|00000d40| 77 68 65 74 68 65 72 20 | 73 75 62 73 65 71 75 65 |whether |subseque|
|00000d50| 6e 74 6c 79 20 6f 70 65 | 6e 65 64 20 77 69 6e 64 |ntly ope|ned wind|
|00000d60| 6f 77 73 20 77 69 6c 6c | 0a 68 61 76 65 20 68 6f |ows will|.have ho|
|00000d70| 72 69 7a 6f 6e 74 61 6c | 20 61 6e 64 2f 6f 72 20 |rizontal| and/or |
|00000d80| 76 65 72 74 69 63 61 6c | 20 73 63 72 6f 6c 6c 20 |vertical| scroll |
|00000d90| 62 61 72 73 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |bars..\e|nd{funcd|
|00000da0| 65 73 63 7d 0a 0a 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00000db0| 63 64 65 73 63 7d 7b 73 | 65 74 64 65 66 77 69 6e |cdesc}{s|etdefwin|
|00000dc0| 70 6f 73 7d 7b 68 5c 2c | 20 76 7d 0a 53 65 74 20 |pos}{h\,| v}.Set |
|00000dd0| 74 68 65 20 64 65 66 61 | 75 6c 74 20 77 69 6e 64 |the defa|ult wind|
|00000de0| 6f 77 20 70 6f 73 69 74 | 69 6f 6e 20 66 6f 72 20 |ow posit|ion for |
|00000df0| 77 69 6e 64 6f 77 73 20 | 6f 70 65 6e 65 64 20 73 |windows |opened s|
|00000e00| 75 62 73 65 71 75 65 6e | 74 6c 79 2e 0a 5c 65 6e |ubsequen|tly..\en|
|00000e10| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0a 0a 5c 62 65 |d{funcde|sc}..\be|
|00000e20| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 73 65 |gin{func|desc}{se|
|00000e30| 74 64 65 66 77 69 6e 73 | 69 7a 65 7d 7b 77 69 64 |tdefwins|ize}{wid|
|00000e40| 74 68 5c 2c 20 68 65 69 | 67 68 74 7d 0a 53 65 74 |th\, hei|ght}.Set|
|00000e50| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 77 69 6e | the def|ault win|
|00000e60| 64 6f 77 20 73 69 7a 65 | 20 66 6f 72 20 77 69 6e |dow size| for win|
|00000e70| 64 6f 77 73 20 6f 70 65 | 6e 65 64 20 73 75 62 73 |dows ope|ned subs|
|00000e80| 65 71 75 65 6e 74 6c 79 | 2e 0a 5c 65 6e 64 7b 66 |equently|..\end{f|
|00000e90| 75 6e 63 64 65 73 63 7d | 0a 0a 5c 62 65 67 69 6e |uncdesc}|..\begin|
|00000ea0| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 67 65 74 64 65 |{funcdes|c}{getde|
|00000eb0| 66 73 63 72 6f 6c 6c 62 | 61 72 73 7d 7b 7d 0a 52 |fscrollb|ars}{}.R|
|00000ec0| 65 74 75 72 6e 20 74 68 | 65 20 66 6c 61 67 73 20 |eturn th|e flags |
|00000ed0| 63 6f 6e 74 72 6f 6c 6c | 69 6e 67 20 77 68 65 74 |controll|ing whet|
|00000ee0| 68 65 72 20 73 75 62 73 | 65 71 75 65 6e 74 6c 79 |her subs|equently|
|00000ef0| 20 6f 70 65 6e 65 64 20 | 77 69 6e 64 6f 77 73 20 | opened |windows |
|00000f00| 77 69 6c 6c 0a 68 61 76 | 65 20 68 6f 72 69 7a 6f |will.hav|e horizo|
|00000f10| 6e 74 61 6c 20 61 6e 64 | 2f 6f 72 20 76 65 72 74 |ntal and|/or vert|
|00000f20| 69 63 61 6c 20 73 63 72 | 6f 6c 6c 20 62 61 72 73 |ical scr|oll bars|
|00000f30| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00000f40| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00000f50| 63 7d 7b 67 65 74 64 65 | 66 77 69 6e 70 6f 73 7d |c}{getde|fwinpos}|
|00000f60| 7b 7d 0a 52 65 74 75 72 | 6e 20 74 68 65 20 64 65 |{}.Retur|n the de|
|00000f70| 66 61 75 6c 74 20 77 69 | 6e 64 6f 77 20 70 6f 73 |fault wi|ndow pos|
|00000f80| 69 74 69 6f 6e 20 66 6f | 72 20 77 69 6e 64 6f 77 |ition fo|r window|
|00000f90| 73 20 6f 70 65 6e 65 64 | 20 73 75 62 73 65 71 75 |s opened| subsequ|
|00000fa0| 65 6e 74 6c 79 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |ently..\|end{func|
|00000fb0| 64 65 73 63 7d 0a 0a 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00000fc0| 6e 63 64 65 73 63 7d 7b | 67 65 74 64 65 66 77 69 |ncdesc}{|getdefwi|
|00000fd0| 6e 73 69 7a 65 7d 7b 7d | 0a 52 65 74 75 72 6e 20 |nsize}{}|.Return |
|00000fe0| 74 68 65 20 64 65 66 61 | 75 6c 74 20 77 69 6e 64 |the defa|ult wind|
|00000ff0| 6f 77 20 73 69 7a 65 20 | 66 6f 72 20 77 69 6e 64 |ow size |for wind|
|00001000| 6f 77 73 20 6f 70 65 6e | 65 64 20 73 75 62 73 65 |ows open|ed subse|
|00001010| 71 75 65 6e 74 6c 79 2e | 0a 5c 65 6e 64 7b 66 75 |quently.|.\end{fu|
|00001020| 6e 63 64 65 73 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00001030| 66 75 6e 63 64 65 73 63 | 7d 7b 67 65 74 73 63 72 |funcdesc|}{getscr|
|00001040| 73 69 7a 65 7d 7b 7d 0a | 52 65 74 75 72 6e 20 74 |size}{}.|Return t|
|00001050| 68 65 20 73 63 72 65 65 | 6e 20 73 69 7a 65 20 69 |he scree|n size i|
|00001060| 6e 20 70 69 78 65 6c 73 | 2e 0a 5c 65 6e 64 7b 66 |n pixels|..\end{f|
|00001070| 75 6e 63 64 65 73 63 7d | 0a 0a 5c 62 65 67 69 6e |uncdesc}|..\begin|
|00001080| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 67 65 74 73 63 |{funcdes|c}{getsc|
|00001090| 72 6d 6d 7d 7b 7d 0a 52 | 65 74 75 72 6e 20 74 68 |rmm}{}.R|eturn th|
|000010a0| 65 20 73 63 72 65 65 6e | 20 73 69 7a 65 20 69 6e |e screen| size in|
|000010b0| 20 6d 69 6c 6c 69 6d 65 | 74 65 72 73 2e 0a 5c 65 | millime|ters..\e|
|000010c0| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0a 0a 5c 62 |nd{funcd|esc}..\b|
|000010d0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 66 |egin{fun|cdesc}{f|
|000010e0| 65 74 63 68 63 6f 6c 6f | 72 7d 7b 63 6f 6c 6f 72 |etchcolo|r}{color|
|000010f0| 6e 61 6d 65 7d 0a 52 65 | 74 75 72 6e 20 74 68 65 |name}.Re|turn the|
|00001100| 20 70 69 78 65 6c 20 76 | 61 6c 75 65 20 63 6f 72 | pixel v|alue cor|
|00001110| 72 65 73 70 6f 6e 64 69 | 6e 67 20 74 6f 20 74 68 |respondi|ng to th|
|00001120| 65 20 67 69 76 65 6e 20 | 63 6f 6c 6f 72 20 6e 61 |e given |color na|
|00001130| 6d 65 2e 0a 52 65 74 75 | 72 6e 20 74 68 65 20 64 |me..Retu|rn the d|
|00001140| 65 66 61 75 6c 74 20 66 | 6f 72 65 67 72 6f 75 6e |efault f|oregroun|
|00001150| 64 20 63 6f 6c 6f 72 20 | 66 6f 72 20 75 6e 6b 6e |d color |for unkn|
|00001160| 6f 77 6e 20 63 6f 6c 6f | 72 20 6e 61 6d 65 73 2e |own colo|r names.|
|00001170| 0a 48 69 6e 74 3a 20 74 | 68 65 20 66 6f 6c 6c 6f |.Hint: t|he follo|
|00001180| 77 69 6e 67 20 63 6f 64 | 65 20 74 65 73 74 73 20 |wing cod|e tests |
|00001190| 77 68 65 74 68 65 72 20 | 79 6f 75 20 61 72 65 20 |whether |you are |
|000011a0| 6f 6e 20 61 20 6d 61 63 | 68 69 6e 65 20 74 68 61 |on a mac|hine tha|
|000011b0| 74 0a 73 75 70 70 6f 72 | 74 73 20 6d 6f 72 65 20 |t.suppor|ts more |
|000011c0| 74 68 61 6e 20 74 77 6f | 20 63 6f 6c 6f 72 73 3a |than two| colors:|
|000011d0| 0a 5c 62 63 6f 64 65 5c | 62 65 67 69 6e 7b 76 65 |.\bcode\|begin{ve|
|000011e0| 72 62 61 74 69 6d 7d 0a | 69 66 20 73 74 64 77 69 |rbatim}.|if stdwi|
|000011f0| 6e 2e 66 65 74 63 68 63 | 6f 6c 6f 72 28 27 62 6c |n.fetchc|olor('bl|
|00001200| 61 63 6b 27 29 20 3c 3e | 20 5c 0a 20 20 20 20 20 |ack') <>| \. |
|00001210| 20 20 20 20 20 73 74 64 | 77 69 6e 2e 66 65 74 63 | std|win.fetc|
|00001220| 68 63 6f 6c 6f 72 28 27 | 72 65 64 27 29 20 3c 3e |hcolor('|red') <>|
|00001230| 20 5c 0a 20 20 20 20 20 | 20 20 20 20 20 73 74 64 | \. | std|
|00001240| 77 69 6e 2e 66 65 74 63 | 68 63 6f 6c 6f 72 28 27 |win.fetc|hcolor('|
|00001250| 77 68 69 74 65 27 29 3a | 0a 20 20 20 20 70 72 69 |white'):|. pri|
|00001260| 6e 74 20 27 63 6f 6c 6f | 72 20 6d 61 63 68 69 6e |nt 'colo|r machin|
|00001270| 65 27 0a 65 6c 73 65 3a | 0a 20 20 20 20 70 72 69 |e'.else:|. pri|
|00001280| 6e 74 20 27 6d 6f 6e 6f | 63 68 72 6f 6d 65 20 6d |nt 'mono|chrome m|
|00001290| 61 63 68 69 6e 65 27 0a | 5c 65 6e 64 7b 76 65 72 |achine'.|\end{ver|
|000012a0| 62 61 74 69 6d 7d 5c 65 | 63 6f 64 65 0a 5c 65 6e |batim}\e|code.\en|
|000012b0| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0a 0a 5c 62 65 |d{funcde|sc}..\be|
|000012c0| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 73 65 |gin{func|desc}{se|
|000012d0| 74 66 67 63 6f 6c 6f 72 | 7d 7b 70 69 78 65 6c 7d |tfgcolor|}{pixel}|
|000012e0| 0a 53 65 74 20 74 68 65 | 20 64 65 66 61 75 6c 74 |.Set the| default|
|000012f0| 20 66 6f 72 65 67 72 6f | 75 6e 64 20 63 6f 6c 6f | foregro|und colo|
|00001300| 72 2e 0a 54 68 69 73 20 | 77 69 6c 6c 20 62 65 63 |r..This |will bec|
|00001310| 6f 6d 65 20 74 68 65 20 | 64 65 66 61 75 6c 74 20 |ome the |default |
|00001320| 66 6f 72 65 67 72 6f 75 | 6e 64 20 63 6f 6c 6f 72 |foregrou|nd color|
|00001330| 20 6f 66 20 77 69 6e 64 | 6f 77 73 20 6f 70 65 6e | of wind|ows open|
|00001340| 65 64 0a 73 75 62 73 65 | 71 75 65 6e 74 6c 79 2c |ed.subse|quently,|
|00001350| 20 69 6e 63 6c 75 64 69 | 6e 67 20 64 69 61 6c 6f | includi|ng dialo|
|00001360| 67 73 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |gs..\end|{funcdes|
|00001370| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00001380| 65 73 63 7d 7b 73 65 74 | 62 67 63 6f 6c 6f 72 7d |esc}{set|bgcolor}|
|00001390| 7b 70 69 78 65 6c 7d 0a | 53 65 74 20 74 68 65 20 |{pixel}.|Set the |
|000013a0| 64 65 66 61 75 6c 74 20 | 62 61 63 6b 67 72 6f 75 |default |backgrou|
|000013b0| 6e 64 20 63 6f 6c 6f 72 | 2e 0a 54 68 69 73 20 77 |nd color|..This w|
|000013c0| 69 6c 6c 20 62 65 63 6f | 6d 65 20 74 68 65 20 64 |ill beco|me the d|
|000013d0| 65 66 61 75 6c 74 20 62 | 61 63 6b 67 72 6f 75 6e |efault b|ackgroun|
|000013e0| 64 20 63 6f 6c 6f 72 20 | 6f 66 20 77 69 6e 64 6f |d color |of windo|
|000013f0| 77 73 20 6f 70 65 6e 65 | 64 0a 73 75 62 73 65 71 |ws opene|d.subseq|
|00001400| 75 65 6e 74 6c 79 2c 20 | 69 6e 63 6c 75 64 69 6e |uently, |includin|
|00001410| 67 20 64 69 61 6c 6f 67 | 73 2e 0a 5c 65 6e 64 7b |g dialog|s..\end{|
|00001420| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00001430| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 67 65 74 66 |n{funcde|sc}{getf|
|00001440| 67 63 6f 6c 6f 72 7d 7b | 7d 0a 52 65 74 75 72 6e |gcolor}{|}.Return|
|00001450| 20 74 68 65 20 70 69 78 | 65 6c 20 76 61 6c 75 65 | the pix|el value|
|00001460| 20 6f 66 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | of the |current |
|00001470| 64 65 66 61 75 6c 74 20 | 66 6f 72 65 67 72 6f 75 |default |foregrou|
|00001480| 6e 64 20 63 6f 6c 6f 72 | 2e 0a 5c 65 6e 64 7b 66 |nd color|..\end{f|
|00001490| 75 6e 63 64 65 73 63 7d | 0a 0a 5c 62 65 67 69 6e |uncdesc}|..\begin|
|000014a0| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 67 65 74 62 67 |{funcdes|c}{getbg|
|000014b0| 63 6f 6c 6f 72 7d 7b 7d | 0a 52 65 74 75 72 6e 20 |color}{}|.Return |
|000014c0| 74 68 65 20 70 69 78 65 | 6c 20 76 61 6c 75 65 20 |the pixe|l value |
|000014d0| 6f 66 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 64 |of the c|urrent d|
|000014e0| 65 66 61 75 6c 74 20 62 | 61 63 6b 67 72 6f 75 6e |efault b|ackgroun|
|000014f0| 64 20 63 6f 6c 6f 72 2e | 0a 5c 65 6e 64 7b 66 75 |d color.|.\end{fu|
|00001500| 6e 63 64 65 73 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00001510| 66 75 6e 63 64 65 73 63 | 7d 7b 73 65 74 66 6f 6e |funcdesc|}{setfon|
|00001520| 74 7d 7b 66 6f 6e 74 6e | 61 6d 65 7d 0a 53 65 74 |t}{fontn|ame}.Set|
|00001530| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 64 65 66 | the cur|rent def|
|00001540| 61 75 6c 74 20 66 6f 6e | 74 2e 0a 54 68 69 73 20 |ault fon|t..This |
|00001550| 77 69 6c 6c 20 62 65 63 | 6f 6d 65 20 74 68 65 20 |will bec|ome the |
|00001560| 64 65 66 61 75 6c 74 20 | 66 6f 6e 74 20 66 6f 72 |default |font for|
|00001570| 20 77 69 6e 64 6f 77 73 | 20 6f 70 65 6e 65 64 20 | windows| opened |
|00001580| 73 75 62 73 65 71 75 65 | 6e 74 6c 79 2c 0a 61 6e |subseque|ntly,.an|
|00001590| 64 20 69 73 20 61 6c 73 | 6f 20 75 73 65 64 20 62 |d is als|o used b|
|000015a0| 79 20 74 68 65 20 74 65 | 78 74 20 6d 65 61 73 75 |y the te|xt measu|
|000015b0| 72 69 6e 67 20 66 75 6e | 63 74 69 6f 6e 73 20 5c |ring fun|ctions \|
|000015c0| 63 6f 64 65 7b 74 65 78 | 74 77 69 64 74 68 7d 2c |code{tex|twidth},|
|000015d0| 0a 5c 63 6f 64 65 7b 74 | 65 78 74 62 72 65 61 6b |.\code{t|extbreak|
|000015e0| 7d 2c 20 5c 63 6f 64 65 | 7b 6c 69 6e 65 68 65 69 |}, \code|{linehei|
|000015f0| 67 68 74 7d 20 61 6e 64 | 20 5c 63 6f 64 65 7b 62 |ght} and| \code{b|
|00001600| 61 73 65 6c 69 6e 65 7d | 20 62 65 6c 6f 77 2e 0a |aseline}| below..|
|00001610| 54 68 69 73 20 61 63 63 | 65 70 74 73 20 74 77 6f |This acc|epts two|
|00001620| 20 6d 6f 72 65 20 6f 70 | 74 69 6f 6e 61 6c 20 70 | more op|tional p|
|00001630| 61 72 61 6d 65 74 65 72 | 73 2c 20 73 69 7a 65 20 |arameter|s, size |
|00001640| 61 6e 64 20 73 74 79 6c | 65 3a 0a 53 69 7a 65 20 |and styl|e:.Size |
|00001650| 69 73 20 74 68 65 20 66 | 6f 6e 74 20 73 69 7a 65 |is the f|ont size|
|00001660| 20 28 69 6e 20 60 70 6f | 69 6e 74 73 27 29 2e 0a | (in `po|ints')..|
|00001670| 53 74 79 6c 65 20 69 73 | 20 61 20 73 69 6e 67 6c |Style is| a singl|
|00001680| 65 20 63 68 61 72 61 63 | 74 65 72 20 73 70 65 63 |e charac|ter spec|
|00001690| 69 66 79 69 6e 67 20 74 | 68 65 20 73 74 79 6c 65 |ifying t|he style|
|000016a0| 2c 20 61 73 20 66 6f 6c | 6c 6f 77 73 3a 0a 5c 63 |, as fol|lows:.\c|
|000016b0| 6f 64 65 7b 27 62 27 7d | 20 3d 20 62 6f 6c 64 2c |ode{'b'}| = bold,|
|000016c0| 0a 5c 63 6f 64 65 7b 27 | 69 27 7d 20 3d 20 69 74 |.\code{'|i'} = it|
|000016d0| 61 6c 69 63 2c 0a 5c 63 | 6f 64 65 7b 27 6f 27 7d |alic,.\c|ode{'o'}|
|000016e0| 20 3d 20 62 6f 6c 64 20 | 2b 20 69 74 61 6c 69 63 | = bold |+ italic|
|000016f0| 2c 0a 5c 63 6f 64 65 7b | 27 75 27 7d 20 3d 20 75 |,.\code{|'u'} = u|
|00001700| 6e 64 65 72 6c 69 6e 65 | 3b 0a 64 65 66 61 75 6c |nderline|;.defaul|
|00001710| 74 20 73 74 79 6c 65 20 | 69 73 20 72 6f 6d 61 6e |t style |is roman|
|00001720| 2e 0a 53 69 7a 65 20 61 | 6e 64 20 73 74 79 6c 65 |..Size a|nd style|
|00001730| 20 61 72 65 20 69 67 6e | 6f 72 65 64 20 75 6e 64 | are ign|ored und|
|00001740| 65 72 20 58 31 31 20 62 | 75 74 20 75 73 65 64 20 |er X11 b|ut used |
|00001750| 6f 6e 20 74 68 65 20 4d | 61 63 69 6e 74 6f 73 68 |on the M|acintosh|
|00001760| 2e 0a 28 53 6f 72 72 79 | 20 66 6f 72 20 61 6c 6c |..(Sorry| for all|
|00001770| 20 74 68 69 73 20 63 6f | 6d 70 6c 65 78 69 74 79 | this co|mplexity|
|00001780| 20 2d 2d 2d 20 61 20 6d | 6f 72 65 20 75 6e 69 66 | --- a m|ore unif|
|00001790| 6f 72 6d 20 69 6e 74 65 | 72 66 61 63 65 20 69 73 |orm inte|rface is|
|000017a0| 20 62 65 69 6e 67 20 64 | 65 73 69 67 6e 65 64 2e | being d|esigned.|
|000017b0| 29 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |).\end{f|uncdesc}|
|000017c0| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|000017d0| 63 7d 7b 6d 65 6e 75 63 | 72 65 61 74 65 7d 7b 74 |c}{menuc|reate}{t|
|000017e0| 69 74 6c 65 7d 0a 43 72 | 65 61 74 65 20 61 20 6d |itle}.Cr|eate a m|
|000017f0| 65 6e 75 20 6f 62 6a 65 | 63 74 20 72 65 66 65 72 |enu obje|ct refer|
|00001800| 72 69 6e 67 20 74 6f 20 | 61 20 67 6c 6f 62 61 6c |ring to |a global|
|00001810| 20 6d 65 6e 75 20 28 61 | 20 6d 65 6e 75 20 74 68 | menu (a| menu th|
|00001820| 61 74 20 61 70 70 65 61 | 72 73 20 69 6e 0a 61 6c |at appea|rs in.al|
|00001830| 6c 20 77 69 6e 64 6f 77 | 73 29 2e 0a 4d 65 74 68 |l window|s)..Meth|
|00001840| 6f 64 73 20 6f 66 20 6d | 65 6e 75 20 6f 62 6a 65 |ods of m|enu obje|
|00001850| 63 74 73 20 61 72 65 20 | 64 65 73 63 72 69 62 65 |cts are |describe|
|00001860| 64 20 62 65 6c 6f 77 2e | 0a 4e 6f 74 65 3a 20 6e |d below.|.Note: n|
|00001870| 6f 72 6d 61 6c 6c 79 2c | 20 6d 65 6e 75 73 20 61 |ormally,| menus a|
|00001880| 72 65 20 63 72 65 61 74 | 65 64 20 6c 6f 63 61 6c |re creat|ed local|
|00001890| 6c 79 3b 20 73 65 65 20 | 74 68 65 20 77 69 6e 64 |ly; see |the wind|
|000018a0| 6f 77 20 6d 65 74 68 6f | 64 0a 5c 63 6f 64 65 7b |ow metho|d.\code{|
|000018b0| 6d 65 6e 75 63 72 65 61 | 74 65 7d 20 62 65 6c 6f |menucrea|te} belo|
|000018c0| 77 2e 0a 5c 73 74 72 6f | 6e 67 7b 57 61 72 6e 69 |w..\stro|ng{Warni|
|000018d0| 6e 67 3a 7d 20 74 68 65 | 20 6d 65 6e 75 20 6f 6e |ng:} the| menu on|
|000018e0| 6c 79 20 61 70 70 65 61 | 72 73 20 69 6e 20 61 20 |ly appea|rs in a |
|000018f0| 77 69 6e 64 6f 77 20 61 | 73 20 6c 6f 6e 67 20 61 |window a|s long a|
|00001900| 73 20 74 68 65 20 6f 62 | 6a 65 63 74 0a 72 65 74 |s the ob|ject.ret|
|00001910| 75 72 6e 65 64 20 62 79 | 20 74 68 69 73 20 63 61 |urned by| this ca|
|00001920| 6c 6c 20 65 78 69 73 74 | 73 2e 0a 5c 65 6e 64 7b |ll exist|s..\end{|
|00001930| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00001940| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 6e 65 77 62 |n{funcde|sc}{newb|
|00001950| 69 74 6d 61 70 7d 7b 77 | 69 64 74 68 5c 2c 20 68 |itmap}{w|idth\, h|
|00001960| 65 69 67 68 74 7d 0a 43 | 72 65 61 74 65 20 61 20 |eight}.C|reate a |
|00001970| 6e 65 77 20 62 69 74 6d | 61 70 20 6f 62 6a 65 63 |new bitm|ap objec|
|00001980| 74 20 6f 66 20 74 68 65 | 20 67 69 76 65 6e 20 64 |t of the| given d|
|00001990| 69 6d 65 6e 73 69 6f 6e | 73 2e 0a 4d 65 74 68 6f |imension|s..Metho|
|000019a0| 64 73 20 6f 66 20 62 69 | 74 6d 61 70 20 6f 62 6a |ds of bi|tmap obj|
|000019b0| 65 63 74 73 20 61 72 65 | 20 64 65 73 63 72 69 62 |ects are| describ|
|000019c0| 65 64 20 62 65 6c 6f 77 | 2e 0a 4e 6f 74 20 61 76 |ed below|..Not av|
|000019d0| 61 69 6c 61 62 6c 65 20 | 6f 6e 20 74 68 65 20 4d |ailable |on the M|
|000019e0| 61 63 69 6e 74 6f 73 68 | 2e 0a 5c 65 6e 64 7b 66 |acintosh|..\end{f|
|000019f0| 75 6e 63 64 65 73 63 7d | 0a 0a 5c 62 65 67 69 6e |uncdesc}|..\begin|
|00001a00| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 66 6c 65 65 70 |{funcdes|c}{fleep|
|00001a10| 7d 7b 7d 0a 43 61 75 73 | 65 20 61 20 62 65 65 70 |}{}.Caus|e a beep|
|00001a20| 20 6f 72 20 62 65 6c 6c | 20 28 6f 72 20 70 65 72 | or bell| (or per|
|00001a30| 68 61 70 73 20 61 20 60 | 76 69 73 75 61 6c 20 62 |haps a `|visual b|
|00001a40| 65 6c 6c 27 20 6f 72 20 | 66 6c 61 73 68 2c 20 68 |ell' or |flash, h|
|00001a50| 65 6e 63 65 20 74 68 65 | 0a 6e 61 6d 65 29 2e 0a |ence the|.name)..|
|00001a60| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a 0a |\end{fun|cdesc}..|
|00001a70| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00001a80| 7b 6d 65 73 73 61 67 65 | 7d 7b 73 74 72 69 6e 67 |{message|}{string|
|00001a90| 7d 0a 44 69 73 70 6c 61 | 79 20 61 20 64 69 61 6c |}.Displa|y a dial|
|00001aa0| 6f 67 20 62 6f 78 20 63 | 6f 6e 74 61 69 6e 69 6e |og box c|ontainin|
|00001ab0| 67 20 74 68 65 20 73 74 | 72 69 6e 67 2e 0a 54 68 |g the st|ring..Th|
|00001ac0| 65 20 75 73 65 72 20 6d | 75 73 74 20 63 6c 69 63 |e user m|ust clic|
|00001ad0| 6b 20 4f 4b 20 62 65 66 | 6f 72 65 20 74 68 65 20 |k OK bef|ore the |
|00001ae0| 66 75 6e 63 74 69 6f 6e | 20 72 65 74 75 72 6e 73 |function| returns|
|00001af0| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00001b00| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00001b10| 63 7d 7b 61 73 6b 79 6e | 63 7d 7b 70 72 6f 6d 70 |c}{askyn|c}{promp|
|00001b20| 74 5c 2c 20 64 65 66 61 | 75 6c 74 7d 0a 44 69 73 |t\, defa|ult}.Dis|
|00001b30| 70 6c 61 79 20 61 20 64 | 69 61 6c 6f 67 20 74 68 |play a d|ialog th|
|00001b40| 61 74 20 70 72 6f 6d 70 | 74 73 20 74 68 65 20 75 |at promp|ts the u|
|00001b50| 73 65 72 20 74 6f 20 61 | 6e 73 77 65 72 20 61 20 |ser to a|nswer a |
|00001b60| 71 75 65 73 74 69 6f 6e | 20 77 69 74 68 20 79 65 |question| with ye|
|00001b70| 73 20 6f 72 0a 6e 6f 2e | 0a 52 65 74 75 72 6e 20 |s or.no.|.Return |
|00001b80| 30 20 66 6f 72 20 6e 6f | 2c 20 31 20 66 6f 72 20 |0 for no|, 1 for |
|00001b90| 79 65 73 2e 0a 49 66 20 | 74 68 65 20 75 73 65 72 |yes..If |the user|
|00001ba0| 20 68 69 74 73 20 74 68 | 65 20 52 65 74 75 72 6e | hits th|e Return|
|00001bb0| 20 6b 65 79 2c 20 74 68 | 65 20 64 65 66 61 75 6c | key, th|e defaul|
|00001bc0| 74 20 28 77 68 69 63 68 | 20 6d 75 73 74 20 62 65 |t (which| must be|
|00001bd0| 20 30 20 6f 72 20 31 29 | 20 69 73 0a 72 65 74 75 | 0 or 1)| is.retu|
|00001be0| 72 6e 65 64 2e 0a 49 66 | 20 74 68 65 20 75 73 65 |rned..If| the use|
|00001bf0| 72 20 63 61 6e 63 65 6c | 73 20 74 68 65 20 64 69 |r cancel|s the di|
|00001c00| 61 6c 6f 67 2c 20 74 68 | 65 0a 5c 63 6f 64 65 7b |alog, th|e.\code{|
|00001c10| 4b 65 79 62 6f 61 72 64 | 49 6e 74 65 72 72 75 70 |Keyboard|Interrup|
|00001c20| 74 7d 0a 65 78 63 65 70 | 74 69 6f 6e 20 69 73 20 |t}.excep|tion is |
|00001c30| 72 61 69 73 65 64 2e 0a | 5c 65 6e 64 7b 66 75 6e |raised..|\end{fun|
|00001c40| 63 64 65 73 63 7d 0a 0a | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00001c50| 75 6e 63 64 65 73 63 7d | 7b 61 73 6b 73 74 72 7d |uncdesc}|{askstr}|
|00001c60| 7b 70 72 6f 6d 70 74 5c | 2c 20 64 65 66 61 75 6c |{prompt\|, defaul|
|00001c70| 74 7d 0a 44 69 73 70 6c | 61 79 20 61 20 64 69 61 |t}.Displ|ay a dia|
|00001c80| 6c 6f 67 20 74 68 61 74 | 20 70 72 6f 6d 70 74 73 |log that| prompts|
|00001c90| 20 74 68 65 20 75 73 65 | 72 20 66 6f 72 20 61 20 | the use|r for a |
|00001ca0| 73 74 72 69 6e 67 2e 0a | 49 66 20 74 68 65 20 75 |string..|If the u|
|00001cb0| 73 65 72 20 68 69 74 73 | 20 74 68 65 20 52 65 74 |ser hits| the Ret|
|00001cc0| 75 72 6e 20 6b 65 79 2c | 20 74 68 65 20 64 65 66 |urn key,| the def|
|00001cd0| 61 75 6c 74 20 73 74 72 | 69 6e 67 20 69 73 20 72 |ault str|ing is r|
|00001ce0| 65 74 75 72 6e 65 64 2e | 0a 49 66 20 74 68 65 20 |eturned.|.If the |
|00001cf0| 75 73 65 72 20 63 61 6e | 63 65 6c 73 20 74 68 65 |user can|cels the|
|00001d00| 20 64 69 61 6c 6f 67 2c | 20 74 68 65 0a 5c 63 6f | dialog,| the.\co|
|00001d10| 64 65 7b 4b 65 79 62 6f | 61 72 64 49 6e 74 65 72 |de{Keybo|ardInter|
|00001d20| 72 75 70 74 7d 0a 65 78 | 63 65 70 74 69 6f 6e 20 |rupt}.ex|ception |
|00001d30| 69 73 20 72 61 69 73 65 | 64 2e 0a 5c 65 6e 64 7b |is raise|d..\end{|
|00001d40| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00001d50| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 61 73 6b 66 |n{funcde|sc}{askf|
|00001d60| 69 6c 65 7d 7b 70 72 6f | 6d 70 74 5c 2c 20 64 65 |ile}{pro|mpt\, de|
|00001d70| 66 61 75 6c 74 5c 2c 20 | 6e 65 77 7d 0a 41 73 6b |fault\, |new}.Ask|
|00001d80| 20 74 68 65 20 75 73 65 | 72 20 74 6f 20 73 70 65 | the use|r to spe|
|00001d90| 63 69 66 79 20 61 20 66 | 69 6c 65 6e 61 6d 65 2e |cify a f|ilename.|
|00001da0| 0a 49 66 0a 5c 76 61 72 | 7b 6e 65 77 7d 0a 69 73 |.If.\var|{new}.is|
|00001db0| 20 7a 65 72 6f 20 69 74 | 20 6d 75 73 74 20 62 65 | zero it| must be|
|00001dc0| 20 61 6e 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c | an exis|ting fil|
|00001dd0| 65 3b 20 6f 74 68 65 72 | 77 69 73 65 2c 20 69 74 |e; other|wise, it|
|00001de0| 20 6d 75 73 74 20 62 65 | 20 61 20 6e 65 77 20 66 | must be| a new f|
|00001df0| 69 6c 65 2e 0a 49 66 20 | 74 68 65 20 75 73 65 72 |ile..If |the user|
|00001e00| 20 63 61 6e 63 65 6c 73 | 20 74 68 65 20 64 69 61 | cancels| the dia|
|00001e10| 6c 6f 67 2c 20 74 68 65 | 0a 5c 63 6f 64 65 7b 4b |log, the|.\code{K|
|00001e20| 65 79 62 6f 61 72 64 49 | 6e 74 65 72 72 75 70 74 |eyboardI|nterrupt|
|00001e30| 7d 0a 65 78 63 65 70 74 | 69 6f 6e 20 69 73 20 72 |}.except|ion is r|
|00001e40| 61 69 73 65 64 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |aised..\|end{func|
|00001e50| 64 65 73 63 7d 0a 0a 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00001e60| 6e 63 64 65 73 63 7d 7b | 73 65 74 63 75 74 62 75 |ncdesc}{|setcutbu|
|00001e70| 66 66 65 72 7d 7b 69 5c | 2c 20 73 74 72 69 6e 67 |ffer}{i\|, string|
|00001e80| 7d 0a 53 74 6f 72 65 20 | 74 68 65 20 73 74 72 69 |}.Store |the stri|
|00001e90| 6e 67 20 69 6e 20 74 68 | 65 20 73 79 73 74 65 6d |ng in th|e system|
|00001ea0| 27 73 20 63 75 74 20 62 | 75 66 66 65 72 20 6e 75 |'s cut b|uffer nu|
|00001eb0| 6d 62 65 72 0a 5c 76 61 | 72 7b 69 7d 2c 0a 77 68 |mber.\va|r{i},.wh|
|00001ec0| 65 72 65 20 69 74 20 63 | 61 6e 20 62 65 20 66 6f |ere it c|an be fo|
|00001ed0| 75 6e 64 20 28 66 6f 72 | 20 70 61 73 74 69 6e 67 |und (for| pasting|
|00001ee0| 29 20 62 79 20 6f 74 68 | 65 72 20 61 70 70 6c 69 |) by oth|er appli|
|00001ef0| 63 61 74 69 6f 6e 73 2e | 0a 4f 6e 20 58 31 31 2c |cations.|.On X11,|
|00001f00| 20 74 68 65 72 65 20 61 | 72 65 20 38 20 63 75 74 | there a|re 8 cut|
|00001f10| 20 62 75 66 66 65 72 73 | 20 28 6e 75 6d 62 65 72 | buffers| (number|
|00001f20| 65 64 20 30 2e 2e 37 29 | 2e 0a 43 75 74 20 62 75 |ed 0..7)|..Cut bu|
|00001f30| 66 66 65 72 20 6e 75 6d | 62 65 72 20 30 20 69 73 |ffer num|ber 0 is|
|00001f40| 20 74 68 65 20 60 63 6c | 69 70 62 6f 61 72 64 27 | the `cl|ipboard'|
|00001f50| 20 6f 6e 20 74 68 65 20 | 4d 61 63 69 6e 74 6f 73 | on the |Macintos|
|00001f60| 68 2e 0a 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |h..\end{|funcdesc|
|00001f70| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|00001f80| 73 63 7d 7b 67 65 74 63 | 75 74 62 75 66 66 65 72 |sc}{getc|utbuffer|
|00001f90| 7d 7b 69 7d 0a 52 65 74 | 75 72 6e 20 74 68 65 20 |}{i}.Ret|urn the |
|00001fa0| 63 6f 6e 74 65 6e 74 73 | 20 6f 66 20 74 68 65 20 |contents| of the |
|00001fb0| 73 79 73 74 65 6d 27 73 | 20 63 75 74 20 62 75 66 |system's| cut buf|
|00001fc0| 66 65 72 20 6e 75 6d 62 | 65 72 0a 5c 76 61 72 7b |fer numb|er.\var{|
|00001fd0| 69 7d 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |i}..\end|{funcdes|
|00001fe0| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00001ff0| 65 73 63 7d 7b 72 6f 74 | 61 74 65 63 75 74 62 75 |esc}{rot|atecutbu|
|00002000| 66 66 65 72 73 7d 7b 6e | 7d 0a 4f 6e 20 58 31 31 |ffers}{n|}.On X11|
|00002010| 2c 20 72 6f 74 61 74 65 | 20 74 68 65 20 38 20 63 |, rotate| the 8 c|
|00002020| 75 74 20 62 75 66 66 65 | 72 73 20 62 79 0a 5c 76 |ut buffe|rs by.\v|
|00002030| 61 72 7b 6e 7d 2e 0a 49 | 67 6e 6f 72 65 64 20 6f |ar{n}..I|gnored o|
|00002040| 6e 20 74 68 65 20 4d 61 | 63 69 6e 74 6f 73 68 2e |n the Ma|cintosh.|
|00002050| 0a 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0a |.\end{fu|ncdesc}.|
|00002060| 0a 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00002070| 7d 7b 67 65 74 73 65 6c | 65 63 74 69 6f 6e 7d 7b |}{getsel|ection}{|
|00002080| 69 7d 0a 52 65 74 75 72 | 6e 20 58 31 31 20 73 65 |i}.Retur|n X11 se|
|00002090| 6c 65 63 74 69 6f 6e 20 | 6e 75 6d 62 65 72 0a 5c |lection |number.\|
|000020a0| 76 61 72 7b 69 2e 7d 0a | 53 65 6c 65 63 74 69 6f |var{i.}.|Selectio|
|000020b0| 6e 73 20 61 72 65 20 6e | 6f 74 20 63 75 74 20 62 |ns are n|ot cut b|
|000020c0| 75 66 66 65 72 73 2e 0a | 53 65 6c 65 63 74 69 6f |uffers..|Selectio|
|000020d0| 6e 20 6e 75 6d 62 65 72 | 73 20 61 72 65 20 64 65 |n number|s are de|
|000020e0| 66 69 6e 65 64 20 69 6e | 20 6d 6f 64 75 6c 65 0a |fined in| module.|
|000020f0| 5c 63 6f 64 65 7b 73 74 | 64 77 69 6e 65 76 65 6e |\code{st|dwineven|
|00002100| 74 73 7d 2e 0a 53 65 6c | 65 63 74 69 6f 6e 20 5c |ts}..Sel|ection \|
|00002110| 63 6f 64 65 7b 57 53 5f | 50 52 49 4d 41 52 59 7d |code{WS_|PRIMARY}|
|00002120| 20 69 73 20 74 68 65 0a | 5c 64 66 6e 7b 70 72 69 | is the.|\dfn{pri|
|00002130| 6d 61 72 79 7d 0a 73 65 | 6c 65 63 74 69 6f 6e 20 |mary}.se|lection |
|00002140| 28 75 73 65 64 20 62 79 | 0a 78 74 65 72 6d 2c 0a |(used by|.xterm,.|
|00002150| 66 6f 72 20 69 6e 73 74 | 61 6e 63 65 29 3b 0a 73 |for inst|ance);.s|
|00002160| 65 6c 65 63 74 69 6f 6e | 20 5c 63 6f 64 65 7b 57 |election| \code{W|
|00002170| 53 5f 53 45 43 4f 4e 44 | 41 52 59 7d 20 69 73 20 |S_SECOND|ARY} is |
|00002180| 74 68 65 0a 5c 64 66 6e | 7b 73 65 63 6f 6e 64 61 |the.\dfn|{seconda|
|00002190| 72 79 7d 0a 73 65 6c 65 | 63 74 69 6f 6e 3b 20 73 |ry}.sele|ction; s|
|000021a0| 65 6c 65 63 74 69 6f 6e | 20 5c 63 6f 64 65 7b 57 |election| \code{W|
|000021b0| 53 5f 43 4c 49 50 42 4f | 41 52 44 7d 20 69 73 20 |S_CLIPBO|ARD} is |
|000021c0| 74 68 65 0a 5c 64 66 6e | 7b 63 6c 69 70 62 6f 61 |the.\dfn|{clipboa|
|000021d0| 72 64 7d 0a 73 65 6c 65 | 63 74 69 6f 6e 20 28 75 |rd}.sele|ction (u|
|000021e0| 73 65 64 20 62 79 0a 78 | 63 6c 69 70 62 6f 61 72 |sed by.x|clipboar|
|000021f0| 64 29 2e 0a 4f 6e 20 74 | 68 65 20 4d 61 63 69 6e |d)..On t|he Macin|
|00002200| 74 6f 73 68 2c 20 74 68 | 69 73 20 61 6c 77 61 79 |tosh, th|is alway|
|00002210| 73 20 72 65 74 75 72 6e | 73 20 61 6e 20 65 6d 70 |s return|s an emp|
|00002220| 74 79 20 73 74 72 69 6e | 67 2e 0a 5c 65 6e 64 7b |ty strin|g..\end{|
|00002230| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00002240| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 72 65 73 65 |n{funcde|sc}{rese|
|00002250| 74 73 65 6c 65 63 74 69 | 6f 6e 7d 7b 69 7d 0a 52 |tselecti|on}{i}.R|
|00002260| 65 73 65 74 20 73 65 6c | 65 63 74 69 6f 6e 20 6e |eset sel|ection n|
|00002270| 75 6d 62 65 72 0a 5c 76 | 61 72 7b 69 7d 2c 0a 69 |umber.\v|ar{i},.i|
|00002280| 66 20 74 68 69 73 20 70 | 72 6f 63 65 73 73 20 6f |f this p|rocess o|
|00002290| 77 6e 73 20 69 74 2e 0a | 28 53 65 65 20 77 69 6e |wns it..|(See win|
|000022a0| 64 6f 77 20 6d 65 74 68 | 6f 64 0a 5c 63 6f 64 65 |dow meth|od.\code|
|000022b0| 7b 73 65 74 73 65 6c 65 | 63 74 69 6f 6e 28 29 7d |{setsele|ction()}|
|000022c0| 29 2e 0a 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |)..\end{|funcdesc|
|000022d0| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|000022e0| 73 63 7d 7b 62 61 73 65 | 6c 69 6e 65 7d 7b 7d 0a |sc}{base|line}{}.|
|000022f0| 52 65 74 75 72 6e 20 74 | 68 65 20 62 61 73 65 6c |Return t|he basel|
|00002300| 69 6e 65 20 6f 66 20 74 | 68 65 20 63 75 72 72 65 |ine of t|he curre|
|00002310| 6e 74 20 66 6f 6e 74 20 | 28 64 65 66 69 6e 65 64 |nt font |(defined|
|00002320| 20 62 79 20 53 54 44 57 | 49 4e 20 61 73 20 74 68 | by STDW|IN as th|
|00002330| 65 0a 76 65 72 74 69 63 | 61 6c 20 64 69 73 74 61 |e.vertic|al dista|
|00002340| 6e 63 65 20 62 65 74 77 | 65 65 6e 20 74 68 65 20 |nce betw|een the |
|00002350| 62 61 73 65 6c 69 6e 65 | 20 61 6e 64 20 74 68 65 |baseline| and the|
|00002360| 20 74 6f 70 20 6f 66 20 | 74 68 65 0a 63 68 61 72 | top of |the.char|
|00002370| 61 63 74 65 72 73 29 2e | 0a 5c 65 6e 64 7b 66 75 |acters).|.\end{fu|
|00002380| 6e 63 64 65 73 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00002390| 66 75 6e 63 64 65 73 63 | 7d 7b 6c 69 6e 65 68 65 |funcdesc|}{linehe|
|000023a0| 69 67 68 74 7d 7b 7d 0a | 52 65 74 75 72 6e 20 74 |ight}{}.|Return t|
|000023b0| 68 65 20 74 6f 74 61 6c | 20 6c 69 6e 65 20 68 65 |he total| line he|
|000023c0| 69 67 68 74 20 6f 66 20 | 74 68 65 20 63 75 72 72 |ight of |the curr|
|000023d0| 65 6e 74 20 66 6f 6e 74 | 2e 0a 5c 65 6e 64 7b 66 |ent font|..\end{f|
|000023e0| 75 6e 63 64 65 73 63 7d | 0a 0a 5c 62 65 67 69 6e |uncdesc}|..\begin|
|000023f0| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 74 65 78 74 62 |{funcdes|c}{textb|
|00002400| 72 65 61 6b 7d 7b 73 74 | 72 5c 2c 20 77 69 64 74 |reak}{st|r\, widt|
|00002410| 68 7d 0a 52 65 74 75 72 | 6e 20 74 68 65 20 6e 75 |h}.Retur|n the nu|
|00002420| 6d 62 65 72 20 6f 66 20 | 63 68 61 72 61 63 74 65 |mber of |characte|
|00002430| 72 73 20 6f 66 20 74 68 | 65 20 73 74 72 69 6e 67 |rs of th|e string|
|00002440| 20 74 68 61 74 20 66 69 | 74 20 69 6e 74 6f 20 61 | that fi|t into a|
|00002450| 20 73 70 61 63 65 20 6f | 66 0a 5c 76 61 72 7b 77 | space o|f.\var{w|
|00002460| 69 64 74 68 7d 0a 62 69 | 74 73 20 77 69 64 65 20 |idth}.bi|ts wide |
|00002470| 77 68 65 6e 20 64 72 61 | 77 6e 20 69 6e 20 74 68 |when dra|wn in th|
|00002480| 65 20 63 75 72 65 6e 74 | 20 66 6f 6e 74 2e 0a 5c |e curent| font..\|
|00002490| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0a 0a 5c |end{func|desc}..\|
|000024a0| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|000024b0| 74 65 78 74 77 69 64 74 | 68 7d 7b 73 74 72 7d 0a |textwidt|h}{str}.|
|000024c0| 52 65 74 75 72 6e 20 74 | 68 65 20 77 69 64 74 68 |Return t|he width|
|000024d0| 20 69 6e 20 62 69 74 73 | 20 6f 66 20 74 68 65 20 | in bits| of the |
|000024e0| 73 74 72 69 6e 67 20 77 | 68 65 6e 20 64 72 61 77 |string w|hen draw|
|000024f0| 6e 20 69 6e 20 74 68 65 | 20 63 75 72 72 65 6e 74 |n in the| current|
|00002500| 20 66 6f 6e 74 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 | font..\|end{func|
|00002510| 64 65 73 63 7d 0a 0a 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00002520| 6e 63 64 65 73 63 7d 7b | 63 6f 6e 6e 65 63 74 69 |ncdesc}{|connecti|
|00002530| 6f 6e 6e 75 6d 62 65 72 | 7d 7b 7d 0a 5c 66 75 6e |onnumber|}{}.\fun|
|00002540| 63 6c 69 6e 65 7b 66 69 | 6c 65 6e 6f 7d 7b 7d 0a |cline{fi|leno}{}.|
|00002550| 28 58 31 31 20 75 6e 64 | 65 72 20 5c 55 4e 49 58 |(X11 und|er \UNIX|
|00002560| 7b 7d 20 6f 6e 6c 79 29 | 20 52 65 74 75 72 6e 20 |{} only)| Return |
|00002570| 74 68 65 20 60 60 63 6f | 6e 6e 65 63 74 69 6f 6e |the ``co|nnection|
|00002580| 20 6e 75 6d 62 65 72 27 | 27 20 75 73 65 64 20 62 | number'|' used b|
|00002590| 79 20 74 68 65 0a 75 6e | 64 65 72 6c 79 69 6e 67 |y the.un|derlying|
|000025a0| 20 58 31 31 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 | X11 imp|lementat|
|000025b0| 69 6f 6e 2e 20 20 28 54 | 68 69 73 20 69 73 20 6e |ion. (T|his is n|
|000025c0| 6f 72 6d 61 6c 6c 79 20 | 74 68 65 20 66 69 6c 65 |ormally |the file|
|000025d0| 20 6e 75 6d 62 65 72 20 | 6f 66 0a 74 68 65 20 73 | number |of.the s|
|000025e0| 6f 63 6b 65 74 2e 29 20 | 20 42 6f 74 68 20 66 75 |ocket.) | Both fu|
|000025f0| 6e 63 74 69 6f 6e 73 20 | 72 65 74 75 72 6e 20 74 |nctions |return t|
|00002600| 68 65 20 73 61 6d 65 20 | 76 61 6c 75 65 3b 0a 5c |he same |value;.\|
|00002610| 63 6f 64 65 7b 63 6f 6e | 6e 65 63 74 69 6f 6e 6e |code{con|nectionn|
|00002620| 75 6d 62 65 72 28 29 7d | 20 69 73 20 6e 61 6d 65 |umber()}| is name|
|00002630| 64 20 61 66 74 65 72 20 | 74 68 65 20 63 6f 72 72 |d after |the corr|
|00002640| 65 73 70 6f 6e 64 69 6e | 67 20 66 75 6e 63 74 69 |espondin|g functi|
|00002650| 6f 6e 20 69 6e 0a 58 31 | 31 20 61 6e 64 20 53 54 |on in.X1|1 and ST|
|00002660| 44 57 49 4e 2c 20 77 68 | 69 6c 65 20 5c 63 6f 64 |DWIN, wh|ile \cod|
|00002670| 65 7b 66 69 6c 65 6e 6f | 28 29 7d 20 6d 61 6b 65 |e{fileno|()} make|
|00002680| 73 20 69 74 20 70 6f 73 | 73 69 62 6c 65 20 74 6f |s it pos|sible to|
|00002690| 20 75 73 65 20 74 68 65 | 0a 5c 63 6f 64 65 7b 73 | use the|.\code{s|
|000026a0| 74 64 77 69 6e 7d 20 6d | 6f 64 75 6c 65 20 61 73 |tdwin} m|odule as|
|000026b0| 20 61 20 60 60 66 69 6c | 65 27 27 20 6f 62 6a 65 | a ``fil|e'' obje|
|000026c0| 63 74 20 70 61 72 61 6d | 65 74 65 72 20 74 6f 0a |ct param|eter to.|
|000026d0| 5c 63 6f 64 65 7b 73 65 | 6c 65 63 74 2e 73 65 6c |\code{se|lect.sel|
|000026e0| 65 63 74 28 29 7d 2e 20 | 20 4e 6f 74 65 20 74 68 |ect()}. | Note th|
|000026f0| 61 74 20 69 66 20 5c 63 | 6f 64 65 7b 73 65 6c 65 |at if \c|ode{sele|
|00002700| 63 74 28 29 7d 20 69 6d | 70 6c 69 65 73 20 74 68 |ct()} im|plies th|
|00002710| 61 74 0a 69 6e 70 75 74 | 20 69 73 20 70 6f 73 73 |at.input| is poss|
|00002720| 69 62 6c 65 20 6f 6e 20 | 5c 63 6f 64 65 7b 73 74 |ible on |\code{st|
|00002730| 64 77 69 6e 7d 2c 20 74 | 68 69 73 20 64 6f 65 73 |dwin}, t|his does|
|00002740| 20 6e 6f 74 20 67 75 61 | 72 61 6e 74 65 65 20 74 | not gua|rantee t|
|00002750| 68 61 74 20 61 6e 0a 65 | 76 65 6e 74 20 69 73 20 |hat an.e|vent is |
|00002760| 72 65 61 64 79 20 2d 2d | 2d 20 69 74 20 6d 61 79 |ready --|- it may|
|00002770| 20 62 65 20 73 6f 6d 65 | 20 69 6e 74 65 72 6e 61 | be some| interna|
|00002780| 6c 20 63 6f 6d 6d 75 6e | 69 63 61 74 69 6f 6e 20 |l commun|ication |
|00002790| 67 6f 69 6e 67 20 6f 6e | 0a 62 65 74 77 65 65 6e |going on|.between|
|000027a0| 20 74 68 65 20 58 20 73 | 65 72 76 65 72 20 61 6e | the X s|erver an|
|000027b0| 64 20 74 68 65 20 63 6c | 69 65 6e 74 20 6c 69 62 |d the cl|ient lib|
|000027c0| 72 61 72 79 2e 20 20 54 | 68 75 73 2c 20 79 6f 75 |rary. T|hus, you|
|000027d0| 20 73 68 6f 75 6c 64 20 | 63 61 6c 6c 0a 5c 63 6f | should |call.\co|
|000027e0| 64 65 7b 73 74 64 77 69 | 6e 2e 70 6f 6c 6c 65 76 |de{stdwi|n.pollev|
|000027f0| 65 6e 74 28 29 7d 20 75 | 6e 74 69 6c 20 69 74 20 |ent()} u|ntil it |
|00002800| 72 65 74 75 72 6e 73 20 | 5c 63 6f 64 65 7b 4e 6f |returns |\code{No|
|00002810| 6e 65 7d 20 74 6f 20 63 | 68 65 63 6b 20 66 6f 72 |ne} to c|heck for|
|00002820| 0a 65 76 65 6e 74 73 20 | 69 66 20 79 6f 75 20 64 |.events |if you d|
|00002830| 6f 6e 27 74 20 77 61 6e | 74 20 79 6f 75 72 20 70 |on't wan|t your p|
|00002840| 72 6f 67 72 61 6d 20 74 | 6f 20 62 6c 6f 63 6b 2e |rogram t|o block.|
|00002850| 20 20 42 65 63 61 75 73 | 65 20 6f 66 20 69 6e 74 | Becaus|e of int|
|00002860| 65 72 6e 61 6c 0a 62 75 | 66 66 65 72 69 6e 67 20 |ernal.bu|ffering |
|00002870| 69 6e 20 58 31 31 2c 20 | 69 74 20 69 73 20 61 6c |in X11, |it is al|
|00002880| 73 6f 20 70 6f 73 73 69 | 62 6c 65 20 74 68 61 74 |so possi|ble that|
|00002890| 20 5c 63 6f 64 65 7b 73 | 74 64 77 69 6e 2e 70 6f | \code{s|tdwin.po|
|000028a0| 6c 6c 65 76 65 6e 74 28 | 29 7d 0a 72 65 74 75 72 |llevent(|)}.retur|
|000028b0| 6e 73 20 61 6e 20 65 76 | 65 6e 74 20 77 68 69 6c |ns an ev|ent whil|
|000028c0| 65 20 5c 63 6f 64 65 7b | 73 65 6c 65 63 74 28 29 |e \code{|select()|
|000028d0| 7d 20 64 6f 65 73 20 6e | 6f 74 20 66 69 6e 64 20 |} does n|ot find |
|000028e0| 5c 63 6f 64 65 7b 73 74 | 64 77 69 6e 7d 20 74 6f |\code{st|dwin} to|
|000028f0| 0a 62 65 20 72 65 61 64 | 79 2c 20 73 6f 20 79 6f |.be read|y, so yo|
|00002900| 75 20 73 68 6f 75 6c 64 | 20 72 65 61 64 20 61 6e |u should| read an|
|00002910| 79 20 70 65 6e 64 69 6e | 67 20 65 76 65 6e 74 73 |y pendin|g events|
|00002920| 20 77 69 74 68 0a 5c 63 | 6f 64 65 7b 73 74 64 77 | with.\c|ode{stdw|
|00002930| 69 6e 2e 70 6f 6c 6c 65 | 76 65 6e 74 28 29 7d 20 |in.polle|vent()} |
|00002940| 75 6e 74 69 6c 20 69 74 | 20 72 65 74 75 72 6e 73 |until it| returns|
|00002950| 20 5c 63 6f 64 65 7b 4e | 6f 6e 65 7d 20 62 65 66 | \code{N|one} bef|
|00002960| 6f 72 65 20 65 6e 74 65 | 72 69 6e 67 0a 61 20 62 |ore ente|ring.a b|
|00002970| 6c 6f 63 6b 69 6e 67 20 | 5c 63 6f 64 65 7b 73 65 |locking |\code{se|
|00002980| 6c 65 63 74 28 29 7d 20 | 63 61 6c 6c 2e 0a 5c 74 |lect()} |call..\t|
|00002990| 74 69 6e 64 65 78 7b 73 | 65 6c 65 63 74 7d 0a 5c |tindex{s|elect}.\|
|000029a0| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0a 0a 5c |end{func|desc}..\|
|000029b0| 73 75 62 73 65 63 74 69 | 6f 6e 7b 57 69 6e 64 6f |subsecti|on{Windo|
|000029c0| 77 20 4f 62 6a 65 63 74 | 73 7d 0a 0a 57 69 6e 64 |w Object|s}..Wind|
|000029d0| 6f 77 20 6f 62 6a 65 63 | 74 73 20 61 72 65 20 63 |ow objec|ts are c|
|000029e0| 72 65 61 74 65 64 20 62 | 79 20 5c 63 6f 64 65 7b |reated b|y \code{|
|000029f0| 73 74 64 77 69 6e 2e 6f | 70 65 6e 28 29 7d 2e 20 |stdwin.o|pen()}. |
|00002a00| 20 54 68 65 79 20 61 72 | 65 20 63 6c 6f 73 65 64 | They ar|e closed|
|00002a10| 0a 62 79 20 74 68 65 69 | 72 20 5c 63 6f 64 65 7b |.by thei|r \code{|
|00002a20| 63 6c 6f 73 65 28 29 7d | 20 6d 65 74 68 6f 64 20 |close()}| method |
|00002a30| 6f 72 20 77 68 65 6e 20 | 74 68 65 79 20 61 72 65 |or when |they are|
|00002a40| 20 67 61 72 62 61 67 65 | 2d 63 6f 6c 6c 65 63 74 | garbage|-collect|
|00002a50| 65 64 2e 0a 57 69 6e 64 | 6f 77 20 6f 62 6a 65 63 |ed..Wind|ow objec|
|00002a60| 74 73 20 68 61 76 65 20 | 74 68 65 20 66 6f 6c 6c |ts have |the foll|
|00002a70| 6f 77 69 6e 67 20 6d 65 | 74 68 6f 64 73 3a 0a 0a |owing me|thods:..|
|00002a80| 5c 72 65 6e 65 77 63 6f | 6d 6d 61 6e 64 7b 5c 69 |\renewco|mmand{\i|
|00002a90| 6e 64 65 78 73 75 62 69 | 74 65 6d 7d 7b 28 77 69 |ndexsubi|tem}{(wi|
|00002aa0| 6e 64 6f 77 20 6d 65 74 | 68 6f 64 29 7d 0a 0a 5c |ndow met|hod)}..\|
|00002ab0| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00002ac0| 62 65 67 69 6e 64 72 61 | 77 69 6e 67 7d 7b 7d 0a |begindra|wing}{}.|
|00002ad0| 52 65 74 75 72 6e 20 61 | 20 64 72 61 77 69 6e 67 |Return a| drawing|
|00002ae0| 20 6f 62 6a 65 63 74 2c | 20 77 68 6f 73 65 20 6d | object,| whose m|
|00002af0| 65 74 68 6f 64 73 20 28 | 64 65 73 63 72 69 62 65 |ethods (|describe|
|00002b00| 64 20 62 65 6c 6f 77 29 | 20 61 6c 6c 6f 77 20 64 |d below)| allow d|
|00002b10| 72 61 77 69 6e 67 0a 69 | 6e 20 74 68 65 20 77 69 |rawing.i|n the wi|
|00002b20| 6e 64 6f 77 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |ndow..\e|nd{funcd|
|00002b30| 65 73 63 7d 0a 0a 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00002b40| 63 64 65 73 63 7d 7b 63 | 68 61 6e 67 65 7d 7b 72 |cdesc}{c|hange}{r|
|00002b50| 65 63 74 7d 0a 49 6e 76 | 61 6c 69 64 61 74 65 20 |ect}.Inv|alidate |
|00002b60| 74 68 65 20 67 69 76 65 | 6e 20 72 65 63 74 61 6e |the give|n rectan|
|00002b70| 67 6c 65 3b 20 74 68 69 | 73 20 6d 61 79 20 63 61 |gle; thi|s may ca|
|00002b80| 75 73 65 20 61 20 64 72 | 61 77 20 65 76 65 6e 74 |use a dr|aw event|
|00002b90| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00002ba0| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00002bb0| 63 7d 7b 67 65 74 74 69 | 74 6c 65 7d 7b 7d 0a 52 |c}{getti|tle}{}.R|
|00002bc0| 65 74 75 72 6e 73 20 74 | 68 65 20 77 69 6e 64 6f |eturns t|he windo|
|00002bd0| 77 27 73 20 74 69 74 6c | 65 20 73 74 72 69 6e 67 |w's titl|e string|
|00002be0| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00002bf0| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00002c00| 63 7d 7b 67 65 74 64 6f | 63 73 69 7a 65 7d 7b 7d |c}{getdo|csize}{}|
|00002c10| 0a 5c 62 65 67 69 6e 7b | 73 6c 6f 70 70 79 70 61 |.\begin{|sloppypa|
|00002c20| 72 7d 0a 52 65 74 75 72 | 6e 20 61 20 70 61 69 72 |r}.Retur|n a pair|
|00002c30| 20 6f 66 20 69 6e 74 65 | 67 65 72 73 20 67 69 76 | of inte|gers giv|
|00002c40| 69 6e 67 20 74 68 65 20 | 73 69 7a 65 20 6f 66 20 |ing the |size of |
|00002c50| 74 68 65 20 64 6f 63 75 | 6d 65 6e 74 20 61 73 20 |the docu|ment as |
|00002c60| 73 65 74 20 62 79 0a 5c | 63 6f 64 65 7b 73 65 74 |set by.\|code{set|
|00002c70| 64 6f 63 73 69 7a 65 28 | 29 7d 2e 0a 5c 65 6e 64 |docsize(|)}..\end|
|00002c80| 7b 73 6c 6f 70 70 79 70 | 61 72 7d 0a 5c 65 6e 64 |{sloppyp|ar}.\end|
|00002c90| 7b 66 75 6e 63 64 65 73 | 63 7d 0a 0a 5c 62 65 67 |{funcdes|c}..\beg|
|00002ca0| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 67 65 74 |in{funcd|esc}{get|
|00002cb0| 6f 72 69 67 69 6e 7d 7b | 7d 0a 52 65 74 75 72 6e |origin}{|}.Return|
|00002cc0| 20 61 20 70 61 69 72 20 | 6f 66 20 69 6e 74 65 67 | a pair |of integ|
|00002cd0| 65 72 73 20 67 69 76 69 | 6e 67 20 74 68 65 20 6f |ers givi|ng the o|
|00002ce0| 72 69 67 69 6e 20 6f 66 | 20 74 68 65 20 77 69 6e |rigin of| the win|
|00002cf0| 64 6f 77 20 77 69 74 68 | 20 72 65 73 70 65 63 74 |dow with| respect|
|00002d00| 0a 74 6f 20 74 68 65 20 | 64 6f 63 75 6d 65 6e 74 |.to the |document|
|00002d10| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00002d20| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00002d30| 63 7d 7b 67 65 74 74 69 | 74 6c 65 7d 7b 7d 0a 52 |c}{getti|tle}{}.R|
|00002d40| 65 74 75 72 6e 20 74 68 | 65 20 77 69 6e 64 6f 77 |eturn th|e window|
|00002d50| 27 73 20 74 69 74 6c 65 | 20 73 74 72 69 6e 67 2e |'s title| string.|
|00002d60| 0a 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0a |.\end{fu|ncdesc}.|
|00002d70| 0a 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00002d80| 7d 7b 67 65 74 77 69 6e | 73 69 7a 65 7d 7b 7d 0a |}{getwin|size}{}.|
|00002d90| 52 65 74 75 72 6e 20 61 | 20 70 61 69 72 20 6f 66 |Return a| pair of|
|00002da0| 20 69 6e 74 65 67 65 72 | 73 20 67 69 76 69 6e 67 | integer|s giving|
|00002db0| 20 74 68 65 20 73 69 7a | 65 20 6f 66 20 74 68 65 | the siz|e of the|
|00002dc0| 20 77 69 6e 64 6f 77 2e | 0a 5c 65 6e 64 7b 66 75 | window.|.\end{fu|
|00002dd0| 6e 63 64 65 73 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00002de0| 66 75 6e 63 64 65 73 63 | 7d 7b 67 65 74 77 69 6e |funcdesc|}{getwin|
|00002df0| 70 6f 73 7d 7b 7d 0a 52 | 65 74 75 72 6e 20 61 20 |pos}{}.R|eturn a |
|00002e00| 70 61 69 72 20 6f 66 20 | 69 6e 74 65 67 65 72 73 |pair of |integers|
|00002e10| 20 67 69 76 69 6e 67 20 | 74 68 65 20 70 6f 73 69 | giving |the posi|
|00002e20| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 77 69 6e 64 |tion of |the wind|
|00002e30| 6f 77 27 73 20 75 70 70 | 65 72 0a 6c 65 66 74 20 |ow's upp|er.left |
|00002e40| 63 6f 72 6e 65 72 20 28 | 72 65 6c 61 74 69 76 65 |corner (|relative|
|00002e50| 20 74 6f 20 74 68 65 20 | 75 70 70 65 72 20 6c 65 | to the |upper le|
|00002e60| 66 74 20 63 6f 72 6e 65 | 72 20 6f 66 20 74 68 65 |ft corne|r of the|
|00002e70| 20 73 63 72 65 65 6e 29 | 2e 0a 5c 65 6e 64 7b 66 | screen)|..\end{f|
|00002e80| 75 6e 63 64 65 73 63 7d | 0a 0a 5c 62 65 67 69 6e |uncdesc}|..\begin|
|00002e90| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 6d 65 6e 75 63 |{funcdes|c}{menuc|
|00002ea0| 72 65 61 74 65 7d 7b 74 | 69 74 6c 65 7d 0a 43 72 |reate}{t|itle}.Cr|
|00002eb0| 65 61 74 65 20 61 20 6d | 65 6e 75 20 6f 62 6a 65 |eate a m|enu obje|
|00002ec0| 63 74 20 72 65 66 65 72 | 72 69 6e 67 20 74 6f 20 |ct refer|ring to |
|00002ed0| 61 20 6c 6f 63 61 6c 20 | 6d 65 6e 75 20 28 61 20 |a local |menu (a |
|00002ee0| 6d 65 6e 75 20 74 68 61 | 74 20 61 70 70 65 61 72 |menu tha|t appear|
|00002ef0| 73 0a 6f 6e 6c 79 20 69 | 6e 20 74 68 69 73 20 77 |s.only i|n this w|
|00002f00| 69 6e 64 6f 77 29 2e 0a | 4d 65 74 68 6f 64 73 20 |indow)..|Methods |
|00002f10| 6f 66 20 6d 65 6e 75 20 | 6f 62 6a 65 63 74 73 20 |of menu |objects |
|00002f20| 61 72 65 20 64 65 73 63 | 72 69 62 65 64 20 62 65 |are desc|ribed be|
|00002f30| 6c 6f 77 2e 0a 7b 5c 62 | 66 20 57 61 72 6e 69 6e |low..{\b|f Warnin|
|00002f40| 67 3a 7d 20 74 68 65 20 | 6d 65 6e 75 20 6f 6e 6c |g:} the |menu onl|
|00002f50| 79 20 61 70 70 65 61 72 | 73 20 61 73 20 6c 6f 6e |y appear|s as lon|
|00002f60| 67 20 61 73 20 74 68 65 | 20 6f 62 6a 65 63 74 0a |g as the| object.|
|00002f70| 72 65 74 75 72 6e 65 64 | 20 62 79 20 74 68 69 73 |returned| by this|
|00002f80| 20 63 61 6c 6c 20 65 78 | 69 73 74 73 2e 0a 5c 65 | call ex|ists..\e|
|00002f90| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0a 0a 5c 62 |nd{funcd|esc}..\b|
|00002fa0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 73 |egin{fun|cdesc}{s|
|00002fb0| 63 72 6f 6c 6c 7d 7b 72 | 65 63 74 5c 2c 20 70 6f |croll}{r|ect\, po|
|00002fc0| 69 6e 74 7d 0a 53 63 72 | 6f 6c 6c 20 74 68 65 20 |int}.Scr|oll the |
|00002fd0| 67 69 76 65 6e 20 72 65 | 63 74 61 6e 67 6c 65 20 |given re|ctangle |
|00002fe0| 62 79 20 74 68 65 20 76 | 65 63 74 6f 72 20 67 69 |by the v|ector gi|
|00002ff0| 76 65 6e 20 62 79 20 74 | 68 65 20 70 6f 69 6e 74 |ven by t|he point|
|00003000| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00003010| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00003020| 63 7d 7b 73 65 74 64 6f | 63 73 69 7a 65 7d 7b 70 |c}{setdo|csize}{p|
|00003030| 6f 69 6e 74 7d 0a 53 65 | 74 20 74 68 65 20 73 69 |oint}.Se|t the si|
|00003040| 7a 65 20 6f 66 20 74 68 | 65 20 64 72 61 77 69 6e |ze of th|e drawin|
|00003050| 67 20 64 6f 63 75 6d 65 | 6e 74 2e 0a 5c 65 6e 64 |g docume|nt..\end|
|00003060| 7b 66 75 6e 63 64 65 73 | 63 7d 0a 0a 5c 62 65 67 |{funcdes|c}..\beg|
|00003070| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 73 65 74 |in{funcd|esc}{set|
|00003080| 6f 72 69 67 69 6e 7d 7b | 70 6f 69 6e 74 7d 0a 4d |origin}{|point}.M|
|00003090| 6f 76 65 20 74 68 65 20 | 6f 72 69 67 69 6e 20 6f |ove the |origin o|
|000030a0| 66 20 74 68 65 20 77 69 | 6e 64 6f 77 20 28 69 74 |f the wi|ndow (it|
|000030b0| 73 20 75 70 70 65 72 20 | 6c 65 66 74 20 63 6f 72 |s upper |left cor|
|000030c0| 6e 65 72 29 0a 74 6f 20 | 74 68 65 20 67 69 76 65 |ner).to |the give|
|000030d0| 6e 20 70 6f 69 6e 74 20 | 69 6e 20 74 68 65 20 64 |n point |in the d|
|000030e0| 6f 63 75 6d 65 6e 74 2e | 0a 5c 65 6e 64 7b 66 75 |ocument.|.\end{fu|
|000030f0| 6e 63 64 65 73 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00003100| 66 75 6e 63 64 65 73 63 | 7d 7b 73 65 74 73 65 6c |funcdesc|}{setsel|
|00003110| 65 63 74 69 6f 6e 7d 7b | 69 5c 2c 20 73 74 72 7d |ection}{|i\, str}|
|00003120| 0a 41 74 74 65 6d 70 74 | 20 74 6f 20 73 65 74 20 |.Attempt| to set |
|00003130| 58 31 31 20 73 65 6c 65 | 63 74 69 6f 6e 20 6e 75 |X11 sele|ction nu|
|00003140| 6d 62 65 72 0a 5c 76 61 | 72 7b 69 7d 0a 74 6f 20 |mber.\va|r{i}.to |
|00003150| 74 68 65 20 73 74 72 69 | 6e 67 0a 5c 76 61 72 7b |the stri|ng.\var{|
|00003160| 73 74 72 7d 2e 0a 28 53 | 65 65 20 73 74 64 77 69 |str}..(S|ee stdwi|
|00003170| 6e 20 6d 65 74 68 6f 64 | 0a 5c 63 6f 64 65 7b 67 |n method|.\code{g|
|00003180| 65 74 73 65 6c 65 63 74 | 69 6f 6e 28 29 7d 0a 66 |etselect|ion()}.f|
|00003190| 6f 72 20 74 68 65 20 6d | 65 61 6e 69 6e 67 20 6f |or the m|eaning o|
|000031a0| 66 0a 5c 76 61 72 7b 69 | 7d 2e 29 0a 52 65 74 75 |f.\var{i|}.).Retu|
|000031b0| 72 6e 20 74 72 75 65 20 | 69 66 20 69 74 20 73 75 |rn true |if it su|
|000031c0| 63 63 65 65 64 73 2e 0a | 49 66 20 20 73 75 63 63 |cceeds..|If succ|
|000031d0| 65 65 64 73 2c 20 74 68 | 65 20 77 69 6e 64 6f 77 |eeds, th|e window|
|000031e0| 20 60 60 6f 77 6e 73 27 | 27 20 74 68 65 20 73 65 | ``owns'|' the se|
|000031f0| 6c 65 63 74 69 6f 6e 20 | 75 6e 74 69 6c 0a 28 61 |lection |until.(a|
|00003200| 29 20 61 6e 6f 74 68 65 | 72 20 61 70 70 6c 69 63 |) anothe|r applic|
|00003210| 61 74 69 6f 6e 20 74 61 | 6b 65 73 20 6f 77 6e 65 |ation ta|kes owne|
|00003220| 72 73 68 69 70 20 6f 66 | 20 74 68 65 20 73 65 6c |rship of| the sel|
|00003230| 65 63 74 69 6f 6e 3b 20 | 6f 72 0a 28 62 29 20 74 |ection; |or.(b) t|
|00003240| 68 65 20 77 69 6e 64 6f | 77 20 69 73 20 64 65 6c |he windo|w is del|
|00003250| 65 74 65 64 3b 20 6f 72 | 0a 28 63 29 20 74 68 65 |eted; or|.(c) the|
|00003260| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 63 6c 65 | applica|tion cle|
|00003270| 61 72 73 20 6f 77 6e 65 | 72 73 68 69 70 20 62 79 |ars owne|rship by|
|00003280| 20 63 61 6c 6c 69 6e 67 | 0a 5c 63 6f 64 65 7b 73 | calling|.\code{s|
|00003290| 74 64 77 69 6e 2e 72 65 | 73 65 74 73 65 6c 65 63 |tdwin.re|setselec|
|000032a0| 74 69 6f 6e 28 5c 76 61 | 72 7b 69 7d 29 7d 2e 0a |tion(\va|r{i})}..|
|000032b0| 57 68 65 6e 20 61 6e 6f | 74 68 65 72 20 61 70 70 |When ano|ther app|
|000032c0| 6c 69 63 61 74 69 6f 6e | 20 74 61 6b 65 73 20 6f |lication| takes o|
|000032d0| 77 6e 65 72 73 68 69 70 | 20 6f 66 20 74 68 65 20 |wnership| of the |
|000032e0| 73 65 6c 65 63 74 69 6f | 6e 2c 20 61 0a 5c 63 6f |selectio|n, a.\co|
|000032f0| 64 65 7b 57 45 5f 4c 4f | 53 54 5f 53 45 4c 7d 0a |de{WE_LO|ST_SEL}.|
|00003300| 65 76 65 6e 74 20 69 73 | 20 72 65 63 65 69 76 65 |event is| receive|
|00003310| 64 20 66 6f 72 20 6e 6f | 20 70 61 72 74 69 63 75 |d for no| particu|
|00003320| 6c 61 72 20 77 69 6e 64 | 6f 77 20 61 6e 64 20 77 |lar wind|ow and w|
|00003330| 69 74 68 20 74 68 65 20 | 73 65 6c 65 63 74 69 6f |ith the |selectio|
|00003340| 6e 20 6e 75 6d 62 65 72 | 0a 61 73 20 64 65 74 61 |n number|.as deta|
|00003350| 69 6c 2e 0a 49 67 6e 6f | 72 65 64 20 6f 6e 20 74 |il..Igno|red on t|
|00003360| 68 65 20 4d 61 63 69 6e | 74 6f 73 68 2e 0a 5c 65 |he Macin|tosh..\e|
|00003370| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0a 0a 5c 62 |nd{funcd|esc}..\b|
|00003380| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 73 |egin{fun|cdesc}{s|
|00003390| 65 74 74 69 6d 65 72 7d | 7b 64 73 65 63 73 7d 0a |ettimer}|{dsecs}.|
|000033a0| 53 63 68 65 64 75 6c 65 | 20 61 20 74 69 6d 65 72 |Schedule| a timer|
|000033b0| 20 65 76 65 6e 74 20 66 | 6f 72 20 74 68 65 20 77 | event f|or the w|
|000033c0| 69 6e 64 6f 77 20 69 6e | 0a 5c 63 6f 64 65 7b 5c |indow in|.\code{\|
|000033d0| 76 61 72 7b 64 73 65 63 | 73 7d 2f 31 30 7d 0a 73 |var{dsec|s}/10}.s|
|000033e0| 65 63 6f 6e 64 73 2e 0a | 5c 65 6e 64 7b 66 75 6e |econds..|\end{fun|
|000033f0| 63 64 65 73 63 7d 0a 0a | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00003400| 75 6e 63 64 65 73 63 7d | 7b 73 65 74 74 69 74 6c |uncdesc}|{settitl|
|00003410| 65 7d 7b 74 69 74 6c 65 | 7d 0a 53 65 74 20 74 68 |e}{title|}.Set th|
|00003420| 65 20 77 69 6e 64 6f 77 | 27 73 20 74 69 74 6c 65 |e window|'s title|
|00003430| 20 73 74 72 69 6e 67 2e | 0a 5c 65 6e 64 7b 66 75 | string.|.\end{fu|
|00003440| 6e 63 64 65 73 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00003450| 66 75 6e 63 64 65 73 63 | 7d 7b 73 65 74 77 69 6e |funcdesc|}{setwin|
|00003460| 63 75 72 73 6f 72 7d 7b | 6e 61 6d 65 7d 0a 5c 62 |cursor}{|name}.\b|
|00003470| 65 67 69 6e 7b 73 6c 6f | 70 70 79 70 61 72 7d 0a |egin{slo|ppypar}.|
|00003480| 53 65 74 20 74 68 65 20 | 77 69 6e 64 6f 77 20 63 |Set the |window c|
|00003490| 75 72 73 6f 72 20 74 6f | 20 61 20 63 75 72 73 6f |ursor to| a curso|
|000034a0| 72 20 6f 66 20 74 68 65 | 20 67 69 76 65 6e 20 6e |r of the| given n|
|000034b0| 61 6d 65 2e 0a 49 74 20 | 72 61 69 73 65 73 20 74 |ame..It |raises t|
|000034c0| 68 65 0a 5c 63 6f 64 65 | 7b 52 75 6e 74 69 6d 65 |he.\code|{Runtime|
|000034d0| 45 72 72 6f 72 7d 0a 65 | 78 63 65 70 74 69 6f 6e |Error}.e|xception|
|000034e0| 20 69 66 20 6e 6f 20 63 | 75 72 73 6f 72 20 6f 66 | if no c|ursor of|
|000034f0| 20 74 68 65 20 67 69 76 | 65 6e 20 6e 61 6d 65 20 | the giv|en name |
|00003500| 65 78 69 73 74 73 2e 0a | 53 75 69 74 61 62 6c 65 |exists..|Suitable|
|00003510| 20 6e 61 6d 65 73 20 69 | 6e 63 6c 75 64 65 0a 5c | names i|nclude.\|
|00003520| 63 6f 64 65 7b 27 69 62 | 65 61 6d 27 7d 2c 0a 5c |code{'ib|eam'},.\|
|00003530| 63 6f 64 65 7b 27 61 72 | 72 6f 77 27 7d 2c 0a 5c |code{'ar|row'},.\|
|00003540| 63 6f 64 65 7b 27 63 72 | 6f 73 73 27 7d 2c 0a 5c |code{'cr|oss'},.\|
|00003550| 63 6f 64 65 7b 27 77 61 | 74 63 68 27 7d 0a 61 6e |code{'wa|tch'}.an|
|00003560| 64 0a 5c 63 6f 64 65 7b | 27 70 6c 75 73 27 7d 2e |d.\code{|'plus'}.|
|00003570| 0a 4f 6e 20 58 31 31 2c | 20 74 68 65 72 65 20 61 |.On X11,| there a|
|00003580| 72 65 20 6d 61 6e 79 20 | 6d 6f 72 65 20 28 73 65 |re many |more (se|
|00003590| 65 0a 5c 66 69 6c 65 7b | 3c 58 31 31 2f 63 75 72 |e.\file{|<X11/cur|
|000035a0| 73 6f 72 66 6f 6e 74 2e | 68 3e 7d 29 2e 0a 5c 65 |sorfont.|h>})..\e|
|000035b0| 6e 64 7b 73 6c 6f 70 70 | 79 70 61 72 7d 0a 5c 65 |nd{slopp|ypar}.\e|
|000035c0| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0a 0a 5c 62 |nd{funcd|esc}..\b|
|000035d0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 73 |egin{fun|cdesc}{s|
|000035e0| 65 74 77 69 6e 70 6f 73 | 7d 7b 68 5c 2c 20 76 7d |etwinpos|}{h\, v}|
|000035f0| 0a 53 65 74 20 74 68 65 | 20 74 68 65 20 70 6f 73 |.Set the| the pos|
|00003600| 69 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 77 69 6e |ition of| the win|
|00003610| 64 6f 77 27 73 20 75 70 | 70 65 72 20 6c 65 66 74 |dow's up|per left|
|00003620| 20 63 6f 72 6e 65 72 20 | 28 72 65 6c 61 74 69 76 | corner |(relativ|
|00003630| 65 20 74 6f 0a 74 68 65 | 20 75 70 70 65 72 20 6c |e to.the| upper l|
|00003640| 65 66 74 20 63 6f 72 6e | 65 72 20 6f 66 20 74 68 |eft corn|er of th|
|00003650| 65 20 73 63 72 65 65 6e | 29 2e 0a 5c 65 6e 64 7b |e screen|)..\end{|
|00003660| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00003670| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 73 65 74 77 |n{funcde|sc}{setw|
|00003680| 69 6e 73 69 7a 65 7d 7b | 77 69 64 74 68 5c 2c 20 |insize}{|width\, |
|00003690| 68 65 69 67 68 74 7d 0a | 53 65 74 20 74 68 65 20 |height}.|Set the |
|000036a0| 77 69 6e 64 6f 77 27 73 | 20 73 69 7a 65 2e 0a 5c |window's| size..\|
|000036b0| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0a 0a 5c |end{func|desc}..\|
|000036c0| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|000036d0| 73 68 6f 77 7d 7b 72 65 | 63 74 7d 0a 54 72 79 20 |show}{re|ct}.Try |
|000036e0| 74 6f 20 65 6e 73 75 72 | 65 20 74 68 61 74 20 74 |to ensur|e that t|
|000036f0| 68 65 20 67 69 76 65 6e | 20 72 65 63 74 61 6e 67 |he given| rectang|
|00003700| 6c 65 20 6f 66 20 74 68 | 65 20 64 6f 63 75 6d 65 |le of th|e docume|
|00003710| 6e 74 20 69 73 20 76 69 | 73 69 62 6c 65 20 69 6e |nt is vi|sible in|
|00003720| 0a 74 68 65 20 77 69 6e | 64 6f 77 2e 0a 5c 65 6e |.the win|dow..\en|
|00003730| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0a 0a 5c 62 65 |d{funcde|sc}..\be|
|00003740| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 74 65 |gin{func|desc}{te|
|00003750| 78 74 63 72 65 61 74 65 | 7d 7b 72 65 63 74 7d 0a |xtcreate|}{rect}.|
|00003760| 43 72 65 61 74 65 20 61 | 20 74 65 78 74 2d 65 64 |Create a| text-ed|
|00003770| 69 74 20 6f 62 6a 65 63 | 74 20 69 6e 20 74 68 65 |it objec|t in the|
|00003780| 20 64 6f 63 75 6d 65 6e | 74 20 61 74 20 74 68 65 | documen|t at the|
|00003790| 20 67 69 76 65 6e 20 72 | 65 63 74 61 6e 67 6c 65 | given r|ectangle|
|000037a0| 2e 0a 4d 65 74 68 6f 64 | 73 20 6f 66 20 74 65 78 |..Method|s of tex|
|000037b0| 74 2d 65 64 69 74 20 6f | 62 6a 65 63 74 73 20 61 |t-edit o|bjects a|
|000037c0| 72 65 20 64 65 73 63 72 | 69 62 65 64 20 62 65 6c |re descr|ibed bel|
|000037d0| 6f 77 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |ow..\end|{funcdes|
|000037e0| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|000037f0| 65 73 63 7d 7b 73 65 74 | 61 63 74 69 76 65 7d 7b |esc}{set|active}{|
|00003800| 7d 0a 41 74 74 65 6d 70 | 74 20 74 6f 20 6d 61 6b |}.Attemp|t to mak|
|00003810| 65 20 74 68 69 73 20 77 | 69 6e 64 6f 77 20 74 68 |e this w|indow th|
|00003820| 65 20 61 63 74 69 76 65 | 20 77 69 6e 64 6f 77 2e |e active| window.|
|00003830| 20 20 49 66 20 73 75 63 | 63 65 73 73 66 75 6c 2c | If suc|cessful,|
|00003840| 20 74 68 69 73 0a 77 69 | 6c 6c 20 67 65 6e 65 72 | this.wi|ll gener|
|00003850| 61 74 65 20 61 20 57 45 | 5f 41 43 54 49 56 41 54 |ate a WE|_ACTIVAT|
|00003860| 45 20 65 76 65 6e 74 20 | 28 61 6e 64 20 61 20 57 |E event |(and a W|
|00003870| 45 5f 44 45 41 43 54 49 | 56 41 54 45 20 65 76 65 |E_DEACTI|VATE eve|
|00003880| 6e 74 20 69 6e 20 63 61 | 73 65 0a 61 6e 6f 74 68 |nt in ca|se.anoth|
|00003890| 65 72 20 77 69 6e 64 6f | 77 20 69 6e 20 74 68 69 |er windo|w in thi|
|000038a0| 73 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 62 65 |s applic|ation be|
|000038b0| 63 61 6d 65 20 69 6e 61 | 63 74 69 76 65 29 2e 0a |came ina|ctive)..|
|000038c0| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a 0a |\end{fun|cdesc}..|
|000038d0| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|000038e0| 7b 63 6c 6f 73 65 7d 7b | 7d 0a 44 69 73 63 61 72 |{close}{|}.Discar|
|000038f0| 64 20 74 68 65 20 77 69 | 6e 64 6f 77 20 6f 62 6a |d the wi|ndow obj|
|00003900| 65 63 74 2e 20 20 49 74 | 20 73 68 6f 75 6c 64 20 |ect. It| should |
|00003910| 6e 6f 74 20 62 65 20 75 | 73 65 64 20 61 67 61 69 |not be u|sed agai|
|00003920| 6e 2e 0a 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |n..\end{|funcdesc|
|00003930| 7d 0a 0a 5c 73 75 62 73 | 65 63 74 69 6f 6e 7b 44 |}..\subs|ection{D|
|00003940| 72 61 77 69 6e 67 20 4f | 62 6a 65 63 74 73 7d 0a |rawing O|bjects}.|
|00003950| 0a 44 72 61 77 69 6e 67 | 20 6f 62 6a 65 63 74 73 |.Drawing| objects|
|00003960| 20 61 72 65 20 63 72 65 | 61 74 65 64 20 65 78 63 | are cre|ated exc|
|00003970| 6c 75 73 69 76 65 6c 79 | 20 62 79 20 74 68 65 20 |lusively| by the |
|00003980| 77 69 6e 64 6f 77 20 6d | 65 74 68 6f 64 0a 5c 63 |window m|ethod.\c|
|00003990| 6f 64 65 7b 62 65 67 69 | 6e 64 72 61 77 69 6e 67 |ode{begi|ndrawing|
|000039a0| 28 29 7d 2e 0a 4f 6e 6c | 79 20 6f 6e 65 20 64 72 |()}..Onl|y one dr|
|000039b0| 61 77 69 6e 67 20 6f 62 | 6a 65 63 74 20 63 61 6e |awing ob|ject can|
|000039c0| 20 65 78 69 73 74 20 61 | 74 20 61 6e 79 20 67 69 | exist a|t any gi|
|000039d0| 76 65 6e 20 74 69 6d 65 | 3b 20 74 68 65 20 64 72 |ven time|; the dr|
|000039e0| 61 77 69 6e 67 20 6f 62 | 6a 65 63 74 0a 6d 75 73 |awing ob|ject.mus|
|000039f0| 74 20 62 65 20 64 65 6c | 65 74 65 64 20 74 6f 20 |t be del|eted to |
|00003a00| 66 69 6e 69 73 68 20 64 | 72 61 77 69 6e 67 2e 0a |finish d|rawing..|
|00003a10| 4e 6f 20 64 72 61 77 69 | 6e 67 20 6f 62 6a 65 63 |No drawi|ng objec|
|00003a20| 74 20 6d 61 79 20 65 78 | 69 73 74 20 77 68 65 6e |t may ex|ist when|
|00003a30| 0a 5c 63 6f 64 65 7b 73 | 74 64 77 69 6e 2e 67 65 |.\code{s|tdwin.ge|
|00003a40| 74 65 76 65 6e 74 28 29 | 7d 0a 69 73 20 63 61 6c |tevent()|}.is cal|
|00003a50| 6c 65 64 2e 0a 44 72 61 | 77 69 6e 67 20 6f 62 6a |led..Dra|wing obj|
|00003a60| 65 63 74 73 20 68 61 76 | 65 20 74 68 65 20 66 6f |ects hav|e the fo|
|00003a70| 6c 6c 6f 77 69 6e 67 20 | 6d 65 74 68 6f 64 73 3a |llowing |methods:|
|00003a80| 0a 0a 5c 72 65 6e 65 77 | 63 6f 6d 6d 61 6e 64 7b |..\renew|command{|
|00003a90| 5c 69 6e 64 65 78 73 75 | 62 69 74 65 6d 7d 7b 28 |\indexsu|bitem}{(|
|00003aa0| 64 72 61 77 69 6e 67 20 | 6d 65 74 68 6f 64 29 7d |drawing |method)}|
|00003ab0| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00003ac0| 63 7d 7b 62 6f 78 7d 7b | 72 65 63 74 7d 0a 44 72 |c}{box}{|rect}.Dr|
|00003ad0| 61 77 20 61 20 62 6f 78 | 20 6a 75 73 74 20 69 6e |aw a box| just in|
|00003ae0| 73 69 64 65 20 61 20 72 | 65 63 74 61 6e 67 6c 65 |side a r|ectangle|
|00003af0| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00003b00| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00003b10| 63 7d 7b 63 69 72 63 6c | 65 7d 7b 63 65 6e 74 65 |c}{circl|e}{cente|
|00003b20| 72 5c 2c 20 72 61 64 69 | 75 73 7d 0a 44 72 61 77 |r\, radi|us}.Draw|
|00003b30| 20 61 20 63 69 72 63 6c | 65 20 77 69 74 68 20 67 | a circl|e with g|
|00003b40| 69 76 65 6e 20 63 65 6e | 74 65 72 20 70 6f 69 6e |iven cen|ter poin|
|00003b50| 74 20 61 6e 64 20 72 61 | 64 69 75 73 2e 0a 5c 65 |t and ra|dius..\e|
|00003b60| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0a 0a 5c 62 |nd{funcd|esc}..\b|
|00003b70| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 65 |egin{fun|cdesc}{e|
|00003b80| 6c 61 72 63 7d 7b 63 65 | 6e 74 65 72 5c 2c 20 5c |larc}{ce|nter\, \|
|00003b90| 28 72 68 5c 2c 20 72 76 | 5c 29 5c 2c 20 5c 28 61 |(rh\, rv|\)\, \(a|
|00003ba0| 31 5c 2c 20 61 32 5c 29 | 7d 0a 44 72 61 77 20 61 |1\, a2\)|}.Draw a|
|00003bb0| 6e 20 65 6c 6c 69 70 74 | 69 63 61 6c 20 61 72 63 |n ellipt|ical arc|
|00003bc0| 20 77 69 74 68 20 67 69 | 76 65 6e 20 63 65 6e 74 | with gi|ven cent|
|00003bd0| 65 72 20 70 6f 69 6e 74 | 2e 0a 5c 63 6f 64 65 7b |er point|..\code{|
|00003be0| 28 5c 76 61 72 7b 72 68 | 7d 2c 20 5c 76 61 72 7b |(\var{rh|}, \var{|
|00003bf0| 72 76 7d 29 7d 0a 67 69 | 76 65 73 20 74 68 65 20 |rv})}.gi|ves the |
|00003c00| 68 61 6c 66 20 73 69 7a | 65 73 20 6f 66 20 74 68 |half siz|es of th|
|00003c10| 65 20 68 6f 72 69 7a 6f | 6e 74 61 6c 20 61 6e 64 |e horizo|ntal and|
|00003c20| 20 76 65 72 74 69 63 61 | 6c 20 72 61 64 69 69 2e | vertica|l radii.|
|00003c30| 0a 5c 63 6f 64 65 7b 28 | 5c 76 61 72 7b 61 31 7d |.\code{(|\var{a1}|
|00003c40| 2c 20 5c 76 61 72 7b 61 | 32 7d 29 7d 0a 67 69 76 |, \var{a|2})}.giv|
|00003c50| 65 73 20 74 68 65 20 61 | 6e 67 6c 65 73 20 28 69 |es the a|ngles (i|
|00003c60| 6e 20 64 65 67 72 65 65 | 73 29 20 6f 66 20 74 68 |n degree|s) of th|
|00003c70| 65 20 62 65 67 69 6e 20 | 61 6e 64 20 65 6e 64 20 |e begin |and end |
|00003c80| 70 6f 69 6e 74 73 2e 0a | 30 20 64 65 67 72 65 65 |points..|0 degree|
|00003c90| 73 20 69 73 20 61 74 20 | 33 20 6f 27 63 6c 6f 63 |s is at |3 o'cloc|
|00003ca0| 6b 2c 20 39 30 20 64 65 | 67 72 65 65 73 20 69 73 |k, 90 de|grees is|
|00003cb0| 20 61 74 20 31 32 20 6f | 27 63 6c 6f 63 6b 2e 0a | at 12 o|'clock..|
|00003cc0| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a 0a |\end{fun|cdesc}..|
|00003cd0| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00003ce0| 7b 65 72 61 73 65 7d 7b | 72 65 63 74 7d 0a 45 72 |{erase}{|rect}.Er|
|00003cf0| 61 73 65 20 61 20 72 65 | 63 74 61 6e 67 6c 65 2e |ase a re|ctangle.|
|00003d00| 0a 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0a |.\end{fu|ncdesc}.|
|00003d10| 0a 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00003d20| 7d 7b 66 69 6c 6c 63 69 | 72 63 6c 65 7d 7b 63 65 |}{fillci|rcle}{ce|
|00003d30| 6e 74 65 72 5c 2c 20 72 | 61 64 69 75 73 7d 0a 44 |nter\, r|adius}.D|
|00003d40| 72 61 77 20 61 20 66 69 | 6c 6c 65 64 20 63 69 72 |raw a fi|lled cir|
|00003d50| 63 6c 65 20 77 69 74 68 | 20 67 69 76 65 6e 20 63 |cle with| given c|
|00003d60| 65 6e 74 65 72 20 70 6f | 69 6e 74 20 61 6e 64 20 |enter po|int and |
|00003d70| 72 61 64 69 75 73 2e 0a | 5c 65 6e 64 7b 66 75 6e |radius..|\end{fun|
|00003d80| 63 64 65 73 63 7d 0a 0a | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00003d90| 75 6e 63 64 65 73 63 7d | 7b 66 69 6c 6c 65 6c 61 |uncdesc}|{fillela|
|00003da0| 72 63 7d 7b 63 65 6e 74 | 65 72 5c 2c 20 5c 28 72 |rc}{cent|er\, \(r|
|00003db0| 68 5c 2c 20 72 76 5c 29 | 5c 2c 20 5c 28 61 31 5c |h\, rv\)|\, \(a1\|
|00003dc0| 2c 20 61 32 5c 29 7d 0a | 44 72 61 77 20 61 20 66 |, a2\)}.|Draw a f|
|00003dd0| 69 6c 6c 65 64 20 65 6c | 6c 69 70 74 69 63 61 6c |illed el|liptical|
|00003de0| 20 61 72 63 3b 20 61 72 | 67 75 6d 65 6e 74 73 20 | arc; ar|guments |
|00003df0| 61 73 20 66 6f 72 20 5c | 63 6f 64 65 7b 65 6c 61 |as for \|code{ela|
|00003e00| 72 63 7d 2e 0a 5c 65 6e | 64 7b 66 75 6e 63 64 65 |rc}..\en|d{funcde|
|00003e10| 73 63 7d 0a 0a 5c 62 65 | 67 69 6e 7b 66 75 6e 63 |sc}..\be|gin{func|
|00003e20| 64 65 73 63 7d 7b 66 69 | 6c 6c 70 6f 6c 79 7d 7b |desc}{fi|llpoly}{|
|00003e30| 70 6f 69 6e 74 73 7d 0a | 44 72 61 77 20 61 20 66 |points}.|Draw a f|
|00003e40| 69 6c 6c 65 64 20 70 6f | 6c 79 67 6f 6e 20 67 69 |illed po|lygon gi|
|00003e50| 76 65 6e 20 62 79 20 61 | 20 6c 69 73 74 20 28 6f |ven by a| list (o|
|00003e60| 72 20 74 75 70 6c 65 29 | 20 6f 66 20 70 6f 69 6e |r tuple)| of poin|
|00003e70| 74 73 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |ts..\end|{funcdes|
|00003e80| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00003e90| 65 73 63 7d 7b 69 6e 76 | 65 72 74 7d 7b 72 65 63 |esc}{inv|ert}{rec|
|00003ea0| 74 7d 0a 49 6e 76 65 72 | 74 20 61 20 72 65 63 74 |t}.Inver|t a rect|
|00003eb0| 61 6e 67 6c 65 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |angle..\|end{func|
|00003ec0| 64 65 73 63 7d 0a 0a 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00003ed0| 6e 63 64 65 73 63 7d 7b | 6c 69 6e 65 7d 7b 70 31 |ncdesc}{|line}{p1|
|00003ee0| 5c 2c 20 70 32 7d 0a 44 | 72 61 77 20 61 20 6c 69 |\, p2}.D|raw a li|
|00003ef0| 6e 65 20 66 72 6f 6d 20 | 70 6f 69 6e 74 0a 5c 76 |ne from |point.\v|
|00003f00| 61 72 7b 70 31 7d 0a 74 | 6f 0a 5c 76 61 72 7b 70 |ar{p1}.t|o.\var{p|
|00003f10| 32 7d 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |2}..\end|{funcdes|
|00003f20| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00003f30| 65 73 63 7d 7b 70 61 69 | 6e 74 7d 7b 72 65 63 74 |esc}{pai|nt}{rect|
|00003f40| 7d 0a 46 69 6c 6c 20 61 | 20 72 65 63 74 61 6e 67 |}.Fill a| rectang|
|00003f50| 6c 65 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |le..\end|{funcdes|
|00003f60| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00003f70| 65 73 63 7d 7b 70 6f 6c | 79 7d 7b 70 6f 69 6e 74 |esc}{pol|y}{point|
|00003f80| 73 7d 0a 44 72 61 77 20 | 74 68 65 20 6c 69 6e 65 |s}.Draw |the line|
|00003f90| 73 20 63 6f 6e 6e 65 63 | 74 69 6e 67 20 74 68 65 |s connec|ting the|
|00003fa0| 20 67 69 76 65 6e 20 6c | 69 73 74 20 28 6f 72 20 | given l|ist (or |
|00003fb0| 74 75 70 6c 65 29 20 6f | 66 20 70 6f 69 6e 74 73 |tuple) o|f points|
|00003fc0| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00003fd0| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00003fe0| 63 7d 7b 73 68 61 64 65 | 7d 7b 72 65 63 74 5c 2c |c}{shade|}{rect\,|
|00003ff0| 20 70 65 72 63 65 6e 74 | 7d 0a 46 69 6c 6c 20 61 | percent|}.Fill a|
|00004000| 20 72 65 63 74 61 6e 67 | 6c 65 20 77 69 74 68 20 | rectang|le with |
|00004010| 61 20 73 68 61 64 69 6e | 67 20 70 61 74 74 65 72 |a shadin|g patter|
|00004020| 6e 20 74 68 61 74 20 69 | 73 20 61 62 6f 75 74 0a |n that i|s about.|
|00004030| 5c 76 61 72 7b 70 65 72 | 63 65 6e 74 7d 0a 70 65 |\var{per|cent}.pe|
|00004040| 72 63 65 6e 74 20 66 69 | 6c 6c 65 64 2e 0a 5c 65 |rcent fi|lled..\e|
|00004050| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0a 0a 5c 62 |nd{funcd|esc}..\b|
|00004060| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 74 |egin{fun|cdesc}{t|
|00004070| 65 78 74 7d 7b 70 5c 2c | 20 73 74 72 7d 0a 44 72 |ext}{p\,| str}.Dr|
|00004080| 61 77 20 61 20 73 74 72 | 69 6e 67 20 73 74 61 72 |aw a str|ing star|
|00004090| 74 69 6e 67 20 61 74 20 | 70 6f 69 6e 74 20 70 20 |ting at |point p |
|000040a0| 28 74 68 65 20 70 6f 69 | 6e 74 20 73 70 65 63 69 |(the poi|nt speci|
|000040b0| 66 69 65 73 20 74 68 65 | 0a 74 6f 70 20 6c 65 66 |fies the|.top lef|
|000040c0| 74 20 63 6f 6f 72 64 69 | 6e 61 74 65 20 6f 66 20 |t coordi|nate of |
|000040d0| 74 68 65 20 73 74 72 69 | 6e 67 29 2e 0a 5c 65 6e |the stri|ng)..\en|
|000040e0| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0a 0a 5c 62 65 |d{funcde|sc}..\be|
|000040f0| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 78 6f |gin{func|desc}{xo|
|00004100| 72 63 69 72 63 6c 65 7d | 7b 63 65 6e 74 65 72 5c |rcircle}|{center\|
|00004110| 2c 20 72 61 64 69 75 73 | 7d 0a 5c 66 75 6e 63 6c |, radius|}.\funcl|
|00004120| 69 6e 65 7b 78 6f 72 65 | 6c 61 72 63 7d 7b 63 65 |ine{xore|larc}{ce|
|00004130| 6e 74 65 72 5c 2c 20 5c | 28 72 68 5c 2c 20 72 76 |nter\, \|(rh\, rv|
|00004140| 5c 29 5c 2c 20 5c 28 61 | 31 5c 2c 20 61 32 5c 29 |\)\, \(a|1\, a2\)|
|00004150| 7d 0a 5c 66 75 6e 63 6c | 69 6e 65 7b 78 6f 72 6c |}.\funcl|ine{xorl|
|00004160| 69 6e 65 7d 7b 70 31 5c | 2c 20 70 32 7d 0a 5c 66 |ine}{p1\|, p2}.\f|
|00004170| 75 6e 63 6c 69 6e 65 7b | 78 6f 72 70 6f 6c 79 7d |uncline{|xorpoly}|
|00004180| 7b 70 6f 69 6e 74 73 7d | 0a 44 72 61 77 20 61 20 |{points}|.Draw a |
|00004190| 63 69 72 63 6c 65 2c 20 | 61 6e 20 65 6c 6c 69 70 |circle, |an ellip|
|000041a0| 74 69 63 61 6c 20 61 72 | 63 2c 20 61 20 6c 69 6e |tical ar|c, a lin|
|000041b0| 65 20 6f 72 20 61 20 70 | 6f 6c 79 67 6f 6e 2c 20 |e or a p|olygon, |
|000041c0| 72 65 73 70 65 63 74 69 | 76 65 6c 79 2c 0a 69 6e |respecti|vely,.in|
|000041d0| 20 58 4f 52 20 6d 6f 64 | 65 2e 0a 5c 65 6e 64 7b | XOR mod|e..\end{|
|000041e0| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|000041f0| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 73 65 74 66 |n{funcde|sc}{setf|
|00004200| 67 63 6f 6c 6f 72 7d 7b | 7d 0a 5c 66 75 6e 63 6c |gcolor}{|}.\funcl|
|00004210| 69 6e 65 7b 73 65 74 62 | 67 63 6f 6c 6f 72 7d 7b |ine{setb|gcolor}{|
|00004220| 7d 0a 5c 66 75 6e 63 6c | 69 6e 65 7b 67 65 74 66 |}.\funcl|ine{getf|
|00004230| 67 63 6f 6c 6f 72 7d 7b | 7d 0a 5c 66 75 6e 63 6c |gcolor}{|}.\funcl|
|00004240| 69 6e 65 7b 67 65 74 62 | 67 63 6f 6c 6f 72 7d 7b |ine{getb|gcolor}{|
|00004250| 7d 0a 54 68 65 73 65 20 | 66 75 6e 63 74 69 6f 6e |}.These |function|
|00004260| 73 20 61 72 65 20 73 69 | 6d 69 6c 61 72 20 74 6f |s are si|milar to|
|00004270| 20 74 68 65 20 63 6f 72 | 72 65 73 70 6f 6e 64 69 | the cor|respondi|
|00004280| 6e 67 20 66 75 6e 63 74 | 69 6f 6e 73 20 64 65 73 |ng funct|ions des|
|00004290| 63 72 69 62 65 64 0a 61 | 62 6f 76 65 20 66 6f 72 |cribed.a|bove for|
|000042a0| 20 74 68 65 0a 5c 63 6f | 64 65 7b 73 74 64 77 69 | the.\co|de{stdwi|
|000042b0| 6e 7d 0a 6d 6f 64 75 6c | 65 2c 20 62 75 74 20 61 |n}.modul|e, but a|
|000042c0| 66 66 65 63 74 20 6f 72 | 20 72 65 74 75 72 6e 20 |ffect or| return |
|000042d0| 74 68 65 20 63 6f 6c 6f | 72 73 20 63 75 72 72 65 |the colo|rs curre|
|000042e0| 6e 74 6c 79 20 75 73 65 | 64 20 66 6f 72 20 64 72 |ntly use|d for dr|
|000042f0| 61 77 69 6e 67 0a 69 6e | 73 74 65 61 64 20 6f 66 |awing.in|stead of|
|00004300| 20 74 68 65 20 67 6c 6f | 62 61 6c 20 64 65 66 61 | the glo|bal defa|
|00004310| 75 6c 74 20 63 6f 6c 6f | 72 73 2e 0a 57 68 65 6e |ult colo|rs..When|
|00004320| 20 61 20 64 72 61 77 69 | 6e 67 20 6f 62 6a 65 63 | a drawi|ng objec|
|00004330| 74 20 69 73 20 63 72 65 | 61 74 65 64 2c 20 69 74 |t is cre|ated, it|
|00004340| 73 20 63 6f 6c 6f 72 73 | 20 61 72 65 20 73 65 74 |s colors| are set|
|00004350| 20 74 6f 20 74 68 65 20 | 77 69 6e 64 6f 77 27 73 | to the |window's|
|00004360| 0a 64 65 66 61 75 6c 74 | 20 63 6f 6c 6f 72 73 2c |.default| colors,|
|00004370| 20 77 68 69 63 68 20 61 | 72 65 20 69 6e 20 74 75 | which a|re in tu|
|00004380| 72 6e 20 69 6e 69 74 69 | 61 6c 69 7a 65 64 20 66 |rn initi|alized f|
|00004390| 72 6f 6d 20 74 68 65 20 | 67 6c 6f 62 61 6c 20 64 |rom the |global d|
|000043a0| 65 66 61 75 6c 74 0a 63 | 6f 6c 6f 72 73 20 77 68 |efault.c|olors wh|
|000043b0| 65 6e 20 74 68 65 20 77 | 69 6e 64 6f 77 20 69 73 |en the w|indow is|
|000043c0| 20 63 72 65 61 74 65 64 | 2e 0a 5c 65 6e 64 7b 66 | created|..\end{f|
|000043d0| 75 6e 63 64 65 73 63 7d | 0a 0a 5c 62 65 67 69 6e |uncdesc}|..\begin|
|000043e0| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 73 65 74 66 6f |{funcdes|c}{setfo|
|000043f0| 6e 74 7d 7b 7d 0a 5c 66 | 75 6e 63 6c 69 6e 65 7b |nt}{}.\f|uncline{|
|00004400| 62 61 73 65 6c 69 6e 65 | 7d 7b 7d 0a 5c 66 75 6e |baseline|}{}.\fun|
|00004410| 63 6c 69 6e 65 7b 6c 69 | 6e 65 68 65 69 67 68 74 |cline{li|neheight|
|00004420| 7d 7b 7d 0a 5c 66 75 6e | 63 6c 69 6e 65 7b 74 65 |}{}.\fun|cline{te|
|00004430| 78 74 62 72 65 61 6b 7d | 7b 7d 0a 5c 66 75 6e 63 |xtbreak}|{}.\func|
|00004440| 6c 69 6e 65 7b 74 65 78 | 74 77 69 64 74 68 7d 7b |line{tex|twidth}{|
|00004450| 7d 0a 54 68 65 73 65 20 | 66 75 6e 63 74 69 6f 6e |}.These |function|
|00004460| 73 20 61 72 65 20 73 69 | 6d 69 6c 61 72 20 74 6f |s are si|milar to|
|00004470| 20 74 68 65 20 63 6f 72 | 72 65 73 70 6f 6e 64 69 | the cor|respondi|
|00004480| 6e 67 20 66 75 6e 63 74 | 69 6f 6e 73 20 64 65 73 |ng funct|ions des|
|00004490| 63 72 69 62 65 64 0a 61 | 62 6f 76 65 20 66 6f 72 |cribed.a|bove for|
|000044a0| 20 74 68 65 0a 5c 63 6f | 64 65 7b 73 74 64 77 69 | the.\co|de{stdwi|
|000044b0| 6e 7d 0a 6d 6f 64 75 6c | 65 2c 20 62 75 74 20 61 |n}.modul|e, but a|
|000044c0| 66 66 65 63 74 20 6f 72 | 20 75 73 65 20 74 68 65 |ffect or| use the|
|000044d0| 20 63 75 72 72 65 6e 74 | 20 64 72 61 77 69 6e 67 | current| drawing|
|000044e0| 20 66 6f 6e 74 20 69 6e | 73 74 65 61 64 20 6f 66 | font in|stead of|
|000044f0| 0a 74 68 65 20 67 6c 6f | 62 61 6c 20 64 65 66 61 |.the glo|bal defa|
|00004500| 75 6c 74 20 66 6f 6e 74 | 2e 0a 57 68 65 6e 20 61 |ult font|..When a|
|00004510| 20 64 72 61 77 69 6e 67 | 20 6f 62 6a 65 63 74 20 | drawing| object |
|00004520| 69 73 20 63 72 65 61 74 | 65 64 2c 20 69 74 73 20 |is creat|ed, its |
|00004530| 66 6f 6e 74 20 69 73 20 | 73 65 74 20 74 6f 20 74 |font is |set to t|
|00004540| 68 65 20 77 69 6e 64 6f | 77 27 73 0a 64 65 66 61 |he windo|w's.defa|
|00004550| 75 6c 74 20 66 6f 6e 74 | 2c 20 77 68 69 63 68 20 |ult font|, which |
|00004560| 69 73 20 69 6e 20 74 75 | 72 6e 20 69 6e 69 74 69 |is in tu|rn initi|
|00004570| 61 6c 69 7a 65 64 20 66 | 72 6f 6d 20 74 68 65 20 |alized f|rom the |
|00004580| 67 6c 6f 62 61 6c 20 64 | 65 66 61 75 6c 74 0a 66 |global d|efault.f|
|00004590| 6f 6e 74 20 77 68 65 6e | 20 74 68 65 20 77 69 6e |ont when| the win|
|000045a0| 64 6f 77 20 69 73 20 63 | 72 65 61 74 65 64 2e 0a |dow is c|reated..|
|000045b0| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a 0a |\end{fun|cdesc}..|
|000045c0| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|000045d0| 7b 62 69 74 6d 61 70 7d | 7b 70 6f 69 6e 74 5c 2c |{bitmap}|{point\,|
|000045e0| 20 62 69 74 6d 61 70 5c | 2c 20 6d 61 73 6b 7d 0a | bitmap\|, mask}.|
|000045f0| 44 72 61 77 20 74 68 65 | 20 5c 76 61 72 7b 62 69 |Draw the| \var{bi|
|00004600| 74 6d 61 70 7d 20 77 69 | 74 68 20 69 74 73 20 74 |tmap} wi|th its t|
|00004610| 6f 70 20 6c 65 66 74 20 | 63 6f 72 6e 65 72 20 61 |op left |corner a|
|00004620| 74 20 5c 76 61 72 7b 70 | 6f 69 6e 74 7d 2e 0a 49 |t \var{p|oint}..I|
|00004630| 66 20 74 68 65 20 6f 70 | 74 69 6f 6e 61 6c 20 5c |f the op|tional \|
|00004640| 76 61 72 7b 6d 61 73 6b | 7d 20 61 72 67 75 6d 65 |var{mask|} argume|
|00004650| 6e 74 20 69 73 20 70 72 | 65 73 65 6e 74 2c 20 69 |nt is pr|esent, i|
|00004660| 74 20 73 68 6f 75 6c 64 | 20 62 65 20 65 69 74 68 |t should| be eith|
|00004670| 65 72 0a 74 68 65 20 73 | 61 6d 65 20 6f 62 6a 65 |er.the s|ame obje|
|00004680| 63 74 20 61 73 20 5c 76 | 61 72 7b 62 69 74 6d 61 |ct as \v|ar{bitma|
|00004690| 70 7d 2c 20 74 6f 20 64 | 72 61 77 20 6f 6e 6c 79 |p}, to d|raw only|
|000046a0| 20 74 68 6f 73 65 20 62 | 69 74 73 20 74 68 61 74 | those b|its that|
|000046b0| 20 61 72 65 20 73 65 74 | 0a 69 6e 20 74 68 65 20 | are set|.in the |
|000046c0| 62 69 74 6d 61 70 2c 20 | 69 6e 20 74 68 65 20 66 |bitmap, |in the f|
|000046d0| 6f 72 65 67 72 6f 75 6e | 64 20 63 6f 6c 6f 72 2c |oregroun|d color,|
|000046e0| 20 6f 72 20 5c 63 6f 64 | 65 7b 4e 6f 6e 65 7d 2c | or \cod|e{None},|
|000046f0| 20 74 6f 20 64 72 61 77 | 20 61 6c 6c 0a 62 69 74 | to draw| all.bit|
|00004700| 73 20 28 6f 6e 65 73 20 | 61 72 65 20 64 72 61 77 |s (ones |are draw|
|00004710| 6e 20 69 6e 20 74 68 65 | 20 66 6f 72 65 67 72 6f |n in the| foregro|
|00004720| 75 6e 64 20 63 6f 6c 6f | 72 2c 20 7a 65 72 6f 73 |und colo|r, zeros|
|00004730| 20 69 6e 20 74 68 65 20 | 62 61 63 6b 67 72 6f 75 | in the |backgrou|
|00004740| 6e 64 0a 63 6f 6c 6f 72 | 29 2e 0a 4e 6f 74 20 61 |nd.color|)..Not a|
|00004750| 76 61 69 6c 61 62 6c 65 | 20 6f 6e 20 74 68 65 20 |vailable| on the |
|00004760| 4d 61 63 69 6e 74 6f 73 | 68 2e 0a 5c 65 6e 64 7b |Macintos|h..\end{|
|00004770| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00004780| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 63 6c 69 70 |n{funcde|sc}{clip|
|00004790| 72 65 63 74 7d 7b 72 65 | 63 74 7d 0a 53 65 74 20 |rect}{re|ct}.Set |
|000047a0| 74 68 65 20 60 60 63 6c | 69 70 70 69 6e 67 20 72 |the ``cl|ipping r|
|000047b0| 65 67 69 6f 6e 27 27 20 | 74 6f 20 61 20 72 65 63 |egion'' |to a rec|
|000047c0| 74 61 6e 67 6c 65 2e 0a | 54 68 65 20 63 6c 69 70 |tangle..|The clip|
|000047d0| 70 69 6e 67 20 72 65 67 | 69 6f 6e 20 6c 69 6d 69 |ping reg|ion limi|
|000047e0| 74 73 20 74 68 65 20 65 | 66 66 65 63 74 20 6f 66 |ts the e|ffect of|
|000047f0| 20 61 6c 6c 20 64 72 61 | 77 69 6e 67 20 6f 70 65 | all dra|wing ope|
|00004800| 72 61 74 69 6f 6e 73 2c | 20 75 6e 74 69 6c 0a 69 |rations,| until.i|
|00004810| 74 20 69 73 20 63 68 61 | 6e 67 65 64 20 61 67 61 |t is cha|nged aga|
|00004820| 69 6e 20 6f 72 20 75 6e | 74 69 6c 20 74 68 65 20 |in or un|til the |
|00004830| 64 72 61 77 69 6e 67 20 | 6f 62 6a 65 63 74 20 69 |drawing |object i|
|00004840| 73 20 63 6c 6f 73 65 64 | 2e 20 20 57 68 65 6e 20 |s closed|. When |
|00004850| 61 0a 64 72 61 77 69 6e | 67 20 6f 62 6a 65 63 74 |a.drawin|g object|
|00004860| 20 69 73 20 63 72 65 61 | 74 65 64 20 74 68 65 20 | is crea|ted the |
|00004870| 63 6c 69 70 70 69 6e 67 | 20 72 65 67 69 6f 6e 20 |clipping| region |
|00004880| 69 73 20 73 65 74 20 74 | 6f 20 74 68 65 20 65 6e |is set t|o the en|
|00004890| 74 69 72 65 0a 77 69 6e | 64 6f 77 2e 20 20 57 68 |tire.win|dow. Wh|
|000048a0| 65 6e 20 61 6e 20 6f 62 | 6a 65 63 74 20 74 6f 20 |en an ob|ject to |
|000048b0| 62 65 20 64 72 61 77 6e | 20 66 61 6c 6c 73 20 70 |be drawn| falls p|
|000048c0| 61 72 74 6c 79 20 6f 75 | 74 73 69 64 65 20 74 68 |artly ou|tside th|
|000048d0| 65 20 63 6c 69 70 70 69 | 6e 67 0a 72 65 67 69 6f |e clippi|ng.regio|
|000048e0| 6e 2c 20 74 68 65 20 73 | 65 74 20 6f 66 20 70 69 |n, the s|et of pi|
|000048f0| 78 65 6c 73 20 64 72 61 | 77 6e 20 69 73 20 74 68 |xels dra|wn is th|
|00004900| 65 20 69 6e 74 65 72 73 | 65 63 74 69 6f 6e 20 6f |e inters|ection o|
|00004910| 66 20 74 68 65 20 63 6c | 69 70 70 69 6e 67 0a 72 |f the cl|ipping.r|
|00004920| 65 67 69 6f 6e 20 61 6e | 64 20 74 68 65 20 73 65 |egion an|d the se|
|00004930| 74 20 6f 66 20 70 69 78 | 65 6c 73 20 74 68 61 74 |t of pix|els that|
|00004940| 20 77 6f 75 6c 64 20 62 | 65 20 64 72 61 77 6e 20 | would b|e drawn |
|00004950| 62 79 20 74 68 65 20 73 | 61 6d 65 20 6f 70 65 72 |by the s|ame oper|
|00004960| 61 74 69 6f 6e 0a 69 6e | 20 74 68 65 20 61 62 73 |ation.in| the abs|
|00004970| 65 6e 63 65 20 6f 66 20 | 61 20 63 6c 69 70 70 69 |ence of |a clippi|
|00004980| 6e 67 20 72 65 67 69 6f | 6e 2e 0a 5c 65 6e 64 7b |ng regio|n..\end{|
|00004990| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|000049a0| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 6e 6f 63 6c |n{funcde|sc}{nocl|
|000049b0| 69 70 7d 7b 7d 0a 52 65 | 73 65 74 20 74 68 65 20 |ip}{}.Re|set the |
|000049c0| 63 6c 69 70 70 69 6e 67 | 20 72 65 67 69 6f 6e 20 |clipping| region |
|000049d0| 74 6f 20 74 68 65 20 65 | 6e 74 69 72 65 20 77 69 |to the e|ntire wi|
|000049e0| 6e 64 6f 77 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |ndow..\e|nd{funcd|
|000049f0| 65 73 63 7d 0a 0a 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00004a00| 63 64 65 73 63 7d 7b 63 | 6c 6f 73 65 7d 7b 7d 0a |cdesc}{c|lose}{}.|
|00004a10| 5c 66 75 6e 63 6c 69 6e | 65 7b 65 6e 64 64 72 61 |\funclin|e{enddra|
|00004a20| 77 69 6e 67 7d 7b 7d 0a | 44 69 73 63 61 72 64 20 |wing}{}.|Discard |
|00004a30| 74 68 65 20 64 72 61 77 | 69 6e 67 20 6f 62 6a 65 |the draw|ing obje|
|00004a40| 63 74 2e 20 20 49 74 20 | 73 68 6f 75 6c 64 20 6e |ct. It |should n|
|00004a50| 6f 74 20 62 65 20 75 73 | 65 64 20 61 67 61 69 6e |ot be us|ed again|
|00004a60| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00004a70| 0a 0a 5c 73 75 62 73 65 | 63 74 69 6f 6e 7b 4d 65 |..\subse|ction{Me|
|00004a80| 6e 75 20 4f 62 6a 65 63 | 74 73 7d 0a 0a 41 20 6d |nu Objec|ts}..A m|
|00004a90| 65 6e 75 20 6f 62 6a 65 | 63 74 20 72 65 70 72 65 |enu obje|ct repre|
|00004aa0| 73 65 6e 74 73 20 61 20 | 6d 65 6e 75 2e 0a 54 68 |sents a |menu..Th|
|00004ab0| 65 20 6d 65 6e 75 20 69 | 73 20 64 65 73 74 72 6f |e menu i|s destro|
|00004ac0| 79 65 64 20 77 68 65 6e | 20 74 68 65 20 6d 65 6e |yed when| the men|
|00004ad0| 75 20 6f 62 6a 65 63 74 | 20 69 73 20 64 65 6c 65 |u object| is dele|
|00004ae0| 74 65 64 2e 0a 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |ted..The| followi|
|00004af0| 6e 67 20 6d 65 74 68 6f | 64 73 20 61 72 65 20 64 |ng metho|ds are d|
|00004b00| 65 66 69 6e 65 64 3a 0a | 0a 5c 72 65 6e 65 77 63 |efined:.|.\renewc|
|00004b10| 6f 6d 6d 61 6e 64 7b 5c | 69 6e 64 65 78 73 75 62 |ommand{\|indexsub|
|00004b20| 69 74 65 6d 7d 7b 28 6d | 65 6e 75 20 6d 65 74 68 |item}{(m|enu meth|
|00004b30| 6f 64 29 7d 0a 0a 5c 62 | 65 67 69 6e 7b 66 75 6e |od)}..\b|egin{fun|
|00004b40| 63 64 65 73 63 7d 7b 61 | 64 64 69 74 65 6d 7d 7b |cdesc}{a|dditem}{|
|00004b50| 74 65 78 74 5c 2c 20 73 | 68 6f 72 74 63 75 74 7d |text\, s|hortcut}|
|00004b60| 0a 41 64 64 20 61 20 6d | 65 6e 75 20 69 74 65 6d |.Add a m|enu item|
|00004b70| 20 77 69 74 68 20 67 69 | 76 65 6e 20 74 65 78 74 | with gi|ven text|
|00004b80| 2e 0a 54 68 65 20 73 68 | 6f 72 74 63 75 74 20 6d |..The sh|ortcut m|
|00004b90| 75 73 74 20 62 65 20 61 | 20 73 74 72 69 6e 67 20 |ust be a| string |
|00004ba0| 6f 66 20 6c 65 6e 67 74 | 68 20 31 2c 20 6f 72 20 |of lengt|h 1, or |
|00004bb0| 6f 6d 69 74 74 65 64 20 | 28 74 6f 20 73 70 65 63 |omitted |(to spec|
|00004bc0| 69 66 79 20 6e 6f 0a 73 | 68 6f 72 74 63 75 74 29 |ify no.s|hortcut)|
|00004bd0| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00004be0| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00004bf0| 63 7d 7b 73 65 74 69 74 | 65 6d 7d 7b 69 5c 2c 20 |c}{setit|em}{i\, |
|00004c00| 74 65 78 74 7d 0a 53 65 | 74 20 74 68 65 20 74 65 |text}.Se|t the te|
|00004c10| 78 74 20 6f 66 20 69 74 | 65 6d 20 6e 75 6d 62 65 |xt of it|em numbe|
|00004c20| 72 0a 5c 76 61 72 7b 69 | 7d 2e 0a 5c 65 6e 64 7b |r.\var{i|}..\end{|
|00004c30| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00004c40| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 65 6e 61 62 |n{funcde|sc}{enab|
|00004c50| 6c 65 7d 7b 69 5c 2c 20 | 66 6c 61 67 7d 0a 45 6e |le}{i\, |flag}.En|
|00004c60| 61 62 6c 65 20 6f 72 20 | 64 69 73 61 62 6c 65 73 |able or |disables|
|00004c70| 20 69 74 65 6d 0a 5c 76 | 61 72 7b 69 7d 2e 0a 5c | item.\v|ar{i}..\|
|00004c80| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0a 0a 5c |end{func|desc}..\|
|00004c90| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00004ca0| 63 68 65 63 6b 7d 7b 69 | 5c 2c 20 66 6c 61 67 7d |check}{i|\, flag}|
|00004cb0| 0a 53 65 74 20 6f 72 20 | 63 6c 65 61 72 20 74 68 |.Set or |clear th|
|00004cc0| 65 0a 5c 64 66 6e 7b 63 | 68 65 63 6b 20 6d 61 72 |e.\dfn{c|heck mar|
|00004cd0| 6b 7d 0a 66 6f 72 20 69 | 74 65 6d 0a 5c 76 61 72 |k}.for i|tem.\var|
|00004ce0| 7b 69 7d 2e 0a 5c 65 6e | 64 7b 66 75 6e 63 64 65 |{i}..\en|d{funcde|
|00004cf0| 73 63 7d 0a 0a 5c 62 65 | 67 69 6e 7b 66 75 6e 63 |sc}..\be|gin{func|
|00004d00| 64 65 73 63 7d 7b 63 6c | 6f 73 65 7d 7b 7d 0a 44 |desc}{cl|ose}{}.D|
|00004d10| 69 73 63 61 72 64 20 74 | 68 65 20 6d 65 6e 75 20 |iscard t|he menu |
|00004d20| 6f 62 6a 65 63 74 2e 20 | 20 49 74 20 73 68 6f 75 |object. | It shou|
|00004d30| 6c 64 20 6e 6f 74 20 62 | 65 20 75 73 65 64 20 61 |ld not b|e used a|
|00004d40| 67 61 69 6e 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |gain..\e|nd{funcd|
|00004d50| 65 73 63 7d 0a 0a 5c 73 | 75 62 73 65 63 74 69 6f |esc}..\s|ubsectio|
|00004d60| 6e 7b 42 69 74 6d 61 70 | 20 4f 62 6a 65 63 74 73 |n{Bitmap| Objects|
|00004d70| 7d 0a 0a 41 20 62 69 74 | 6d 61 70 20 72 65 70 72 |}..A bit|map repr|
|00004d80| 65 73 65 6e 74 73 20 61 | 20 72 65 63 74 61 6e 67 |esents a| rectang|
|00004d90| 75 6c 61 72 20 61 72 72 | 61 79 20 6f 66 20 62 69 |ular arr|ay of bi|
|00004da0| 74 73 2e 0a 54 68 65 20 | 74 6f 70 20 6c 65 66 74 |ts..The |top left|
|00004db0| 20 62 69 74 20 68 61 73 | 20 63 6f 6f 72 64 69 6e | bit has| coordin|
|00004dc0| 61 74 65 20 28 30 2c 20 | 30 29 2e 0a 41 20 62 69 |ate (0, |0)..A bi|
|00004dd0| 74 6d 61 70 20 63 61 6e | 20 62 65 20 64 72 61 77 |tmap can| be draw|
|00004de0| 6e 20 77 69 74 68 20 74 | 68 65 20 5c 63 6f 64 65 |n with t|he \code|
|00004df0| 7b 62 69 74 6d 61 70 7d | 20 6d 65 74 68 6f 64 20 |{bitmap}| method |
|00004e00| 6f 66 20 61 20 64 72 61 | 77 69 6e 67 20 6f 62 6a |of a dra|wing obj|
|00004e10| 65 63 74 2e 0a 42 69 74 | 6d 61 70 73 20 61 72 65 |ect..Bit|maps are|
|00004e20| 20 63 75 72 72 65 6e 74 | 6c 79 20 6e 6f 74 20 61 | current|ly not a|
|00004e30| 76 61 69 6c 61 62 6c 65 | 20 6f 6e 20 74 68 65 20 |vailable| on the |
|00004e40| 4d 61 63 69 6e 74 6f 73 | 68 2e 0a 0a 54 68 65 20 |Macintos|h...The |
|00004e50| 66 6f 6c 6c 6f 77 69 6e | 67 20 6d 65 74 68 6f 64 |followin|g method|
|00004e60| 73 20 61 72 65 20 64 65 | 66 69 6e 65 64 3a 0a 0a |s are de|fined:..|
|00004e70| 5c 72 65 6e 65 77 63 6f | 6d 6d 61 6e 64 7b 5c 69 |\renewco|mmand{\i|
|00004e80| 6e 64 65 78 73 75 62 69 | 74 65 6d 7d 7b 28 62 69 |ndexsubi|tem}{(bi|
|00004e90| 74 6d 61 70 20 6d 65 74 | 68 6f 64 29 7d 0a 0a 5c |tmap met|hod)}..\|
|00004ea0| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00004eb0| 67 65 74 73 69 7a 65 7d | 7b 7d 0a 52 65 74 75 72 |getsize}|{}.Retur|
|00004ec0| 6e 20 61 20 74 75 70 6c | 65 20 72 65 70 72 65 73 |n a tupl|e repres|
|00004ed0| 65 6e 74 69 6e 67 20 74 | 68 65 20 77 69 64 74 68 |enting t|he width|
|00004ee0| 20 61 6e 64 20 68 65 69 | 67 68 74 20 6f 66 20 74 | and hei|ght of t|
|00004ef0| 68 65 20 62 69 74 6d 61 | 70 2e 0a 28 54 68 69 73 |he bitma|p..(This|
|00004f00| 20 72 65 74 75 72 6e 73 | 20 74 68 65 20 76 61 6c | returns| the val|
|00004f10| 75 65 73 20 74 68 61 74 | 20 68 61 76 65 20 62 65 |ues that| have be|
|00004f20| 65 6e 20 70 61 73 73 65 | 64 20 74 6f 20 74 68 65 |en passe|d to the|
|00004f30| 20 5c 63 6f 64 65 7b 6e | 65 77 62 69 74 6d 61 70 | \code{n|ewbitmap|
|00004f40| 7d 0a 66 75 6e 63 74 69 | 6f 6e 2e 29 0a 5c 65 6e |}.functi|on.).\en|
|00004f50| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0a 0a 5c 62 65 |d{funcde|sc}..\be|
|00004f60| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 73 65 |gin{func|desc}{se|
|00004f70| 74 62 69 74 7d 7b 70 6f | 69 6e 74 5c 2c 20 62 69 |tbit}{po|int\, bi|
|00004f80| 74 7d 0a 53 65 74 20 74 | 68 65 20 76 61 6c 75 65 |t}.Set t|he value|
|00004f90| 20 6f 66 20 74 68 65 20 | 62 69 74 20 69 6e 64 69 | of the |bit indi|
|00004fa0| 63 61 74 65 64 20 62 79 | 20 5c 76 61 72 7b 70 6f |cated by| \var{po|
|00004fb0| 69 6e 74 7d 20 74 6f 20 | 5c 76 61 72 7b 62 69 74 |int} to |\var{bit|
|00004fc0| 7d 2e 0a 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |}..\end{|funcdesc|
|00004fd0| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|00004fe0| 73 63 7d 7b 67 65 74 62 | 69 74 7d 7b 70 6f 69 6e |sc}{getb|it}{poin|
|00004ff0| 74 7d 0a 52 65 74 75 72 | 6e 20 74 68 65 20 76 61 |t}.Retur|n the va|
|00005000| 6c 75 65 20 6f 66 20 74 | 68 65 20 62 69 74 20 69 |lue of t|he bit i|
|00005010| 6e 64 69 63 61 74 65 64 | 20 62 79 20 5c 76 61 72 |ndicated| by \var|
|00005020| 7b 70 6f 69 6e 74 7d 2e | 0a 5c 65 6e 64 7b 66 75 |{point}.|.\end{fu|
|00005030| 6e 63 64 65 73 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00005040| 66 75 6e 63 64 65 73 63 | 7d 7b 63 6c 6f 73 65 7d |funcdesc|}{close}|
|00005050| 7b 7d 0a 44 69 73 63 61 | 72 64 20 74 68 65 20 62 |{}.Disca|rd the b|
|00005060| 69 74 6d 61 70 20 6f 62 | 6a 65 63 74 2e 20 20 49 |itmap ob|ject. I|
|00005070| 74 20 73 68 6f 75 6c 64 | 20 6e 6f 74 20 62 65 20 |t should| not be |
|00005080| 75 73 65 64 20 61 67 61 | 69 6e 2e 0a 5c 65 6e 64 |used aga|in..\end|
|00005090| 7b 66 75 6e 63 64 65 73 | 63 7d 0a 0a 5c 73 75 62 |{funcdes|c}..\sub|
|000050a0| 73 65 63 74 69 6f 6e 7b | 54 65 78 74 2d 65 64 69 |section{|Text-edi|
|000050b0| 74 20 4f 62 6a 65 63 74 | 73 7d 0a 0a 41 20 74 65 |t Object|s}..A te|
|000050c0| 78 74 2d 65 64 69 74 20 | 6f 62 6a 65 63 74 20 72 |xt-edit |object r|
|000050d0| 65 70 72 65 73 65 6e 74 | 73 20 61 20 74 65 78 74 |epresent|s a text|
|000050e0| 2d 65 64 69 74 20 62 6c | 6f 63 6b 2e 0a 46 6f 72 |-edit bl|ock..For|
|000050f0| 20 73 65 6d 61 6e 74 69 | 63 73 2c 20 73 65 65 20 | semanti|cs, see |
|00005100| 74 68 65 20 53 54 44 57 | 49 4e 20 64 6f 63 75 6d |the STDW|IN docum|
|00005110| 65 6e 74 61 74 69 6f 6e | 20 66 6f 72 20 43 20 70 |entation| for C p|
|00005120| 72 6f 67 72 61 6d 6d 65 | 72 73 2e 0a 54 68 65 20 |rogramme|rs..The |
|00005130| 66 6f 6c 6c 6f 77 69 6e | 67 20 6d 65 74 68 6f 64 |followin|g method|
|00005140| 73 20 65 78 69 73 74 3a | 0a 0a 5c 72 65 6e 65 77 |s exist:|..\renew|
|00005150| 63 6f 6d 6d 61 6e 64 7b | 5c 69 6e 64 65 78 73 75 |command{|\indexsu|
|00005160| 62 69 74 65 6d 7d 7b 28 | 74 65 78 74 2d 65 64 69 |bitem}{(|text-edi|
|00005170| 74 20 6d 65 74 68 6f 64 | 29 7d 0a 0a 5c 62 65 67 |t method|)}..\beg|
|00005180| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 61 72 72 |in{funcd|esc}{arr|
|00005190| 6f 77 7d 7b 63 6f 64 65 | 7d 0a 50 61 73 73 20 61 |ow}{code|}.Pass a|
|000051a0| 6e 20 61 72 72 6f 77 20 | 65 76 65 6e 74 20 74 6f |n arrow |event to|
|000051b0| 20 74 68 65 20 74 65 78 | 74 2d 65 64 69 74 20 62 | the tex|t-edit b|
|000051c0| 6c 6f 63 6b 2e 0a 54 68 | 65 0a 5c 76 61 72 7b 63 |lock..Th|e.\var{c|
|000051d0| 6f 64 65 7d 0a 6d 75 73 | 74 20 62 65 20 6f 6e 65 |ode}.mus|t be one|
|000051e0| 20 6f 66 0a 5c 63 6f 64 | 65 7b 57 43 5f 4c 45 46 | of.\cod|e{WC_LEF|
|000051f0| 54 7d 2c 0a 5c 63 6f 64 | 65 7b 57 43 5f 52 49 47 |T},.\cod|e{WC_RIG|
|00005200| 48 54 7d 2c 0a 5c 63 6f | 64 65 7b 57 43 5f 55 50 |HT},.\co|de{WC_UP|
|00005210| 7d 0a 6f 72 0a 5c 63 6f | 64 65 7b 57 43 5f 44 4f |}.or.\co|de{WC_DO|
|00005220| 57 4e 7d 0a 28 73 65 65 | 20 6d 6f 64 75 6c 65 0a |WN}.(see| module.|
|00005230| 5c 63 6f 64 65 7b 73 74 | 64 77 69 6e 65 76 65 6e |\code{st|dwineven|
|00005240| 74 73 7d 29 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |ts})..\e|nd{funcd|
|00005250| 65 73 63 7d 0a 0a 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00005260| 63 64 65 73 63 7d 7b 64 | 72 61 77 7d 7b 72 65 63 |cdesc}{d|raw}{rec|
|00005270| 74 7d 0a 50 61 73 73 20 | 61 20 64 72 61 77 20 65 |t}.Pass |a draw e|
|00005280| 76 65 6e 74 20 74 6f 20 | 74 68 65 20 74 65 78 74 |vent to |the text|
|00005290| 2d 65 64 69 74 20 62 6c | 6f 63 6b 2e 0a 54 68 65 |-edit bl|ock..The|
|000052a0| 20 72 65 63 74 61 6e 67 | 6c 65 20 73 70 65 63 69 | rectang|le speci|
|000052b0| 66 69 65 73 20 74 68 65 | 20 72 65 64 72 61 77 20 |fies the| redraw |
|000052c0| 61 72 65 61 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |area..\e|nd{funcd|
|000052d0| 65 73 63 7d 0a 0a 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|000052e0| 63 64 65 73 63 7d 7b 65 | 76 65 6e 74 7d 7b 74 79 |cdesc}{e|vent}{ty|
|000052f0| 70 65 5c 2c 20 77 69 6e | 64 6f 77 5c 2c 20 64 65 |pe\, win|dow\, de|
|00005300| 74 61 69 6c 7d 0a 50 61 | 73 73 20 61 6e 20 65 76 |tail}.Pa|ss an ev|
|00005310| 65 6e 74 20 67 6f 74 74 | 65 6e 20 66 72 6f 6d 0a |ent gott|en from.|
|00005320| 5c 63 6f 64 65 7b 73 74 | 64 77 69 6e 2e 67 65 74 |\code{st|dwin.get|
|00005330| 65 76 65 6e 74 28 29 7d | 0a 74 6f 20 74 68 65 20 |event()}|.to the |
|00005340| 74 65 78 74 2d 65 64 69 | 74 20 62 6c 6f 63 6b 2e |text-edi|t block.|
|00005350| 0a 52 65 74 75 72 6e 20 | 74 72 75 65 20 69 66 20 |.Return |true if |
|00005360| 74 68 65 20 65 76 65 6e | 74 20 77 61 73 20 68 61 |the even|t was ha|
|00005370| 6e 64 6c 65 64 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |ndled..\|end{func|
|00005380| 64 65 73 63 7d 0a 0a 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00005390| 6e 63 64 65 73 63 7d 7b | 67 65 74 66 6f 63 75 73 |ncdesc}{|getfocus|
|000053a0| 7d 7b 7d 0a 52 65 74 75 | 72 6e 20 32 20 69 6e 74 |}{}.Retu|rn 2 int|
|000053b0| 65 67 65 72 73 20 72 65 | 70 72 65 73 65 6e 74 69 |egers re|presenti|
|000053c0| 6e 67 20 74 68 65 20 73 | 74 61 72 74 20 61 6e 64 |ng the s|tart and|
|000053d0| 20 65 6e 64 20 70 6f 73 | 69 74 69 6f 6e 73 20 6f | end pos|itions o|
|000053e0| 66 20 74 68 65 0a 66 6f | 63 75 73 2c 20 75 73 61 |f the.fo|cus, usa|
|000053f0| 62 6c 65 20 61 73 20 73 | 6c 69 63 65 20 69 6e 64 |ble as s|lice ind|
|00005400| 69 63 65 73 20 6f 6e 20 | 74 68 65 20 73 74 72 69 |ices on |the stri|
|00005410| 6e 67 20 72 65 74 75 72 | 6e 65 64 20 62 79 0a 5c |ng retur|ned by.\|
|00005420| 63 6f 64 65 7b 67 65 74 | 74 65 78 74 28 29 7d 2e |code{get|text()}.|
|00005430| 0a 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0a |.\end{fu|ncdesc}.|
|00005440| 0a 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00005450| 7d 7b 67 65 74 66 6f 63 | 75 73 74 65 78 74 7d 7b |}{getfoc|ustext}{|
|00005460| 7d 0a 52 65 74 75 72 6e | 20 74 68 65 20 74 65 78 |}.Return| the tex|
|00005470| 74 20 69 6e 20 74 68 65 | 20 66 6f 63 75 73 2e 0a |t in the| focus..|
|00005480| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a 0a |\end{fun|cdesc}..|
|00005490| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|000054a0| 7b 67 65 74 72 65 63 74 | 7d 7b 7d 0a 52 65 74 75 |{getrect|}{}.Retu|
|000054b0| 72 6e 20 61 20 72 65 63 | 74 61 6e 67 6c 65 20 67 |rn a rec|tangle g|
|000054c0| 69 76 69 6e 67 20 74 68 | 65 20 61 63 74 75 61 6c |iving th|e actual|
|000054d0| 20 70 6f 73 69 74 69 6f | 6e 20 6f 66 20 74 68 65 | positio|n of the|
|000054e0| 20 74 65 78 74 2d 65 64 | 69 74 20 62 6c 6f 63 6b | text-ed|it block|
|000054f0| 2e 0a 28 54 68 65 20 62 | 6f 74 74 6f 6d 20 63 6f |..(The b|ottom co|
|00005500| 6f 72 64 69 6e 61 74 65 | 20 6d 61 79 20 64 69 66 |ordinate| may dif|
|00005510| 66 65 72 20 66 72 6f 6d | 20 74 68 65 20 69 6e 69 |fer from| the ini|
|00005520| 74 69 61 6c 20 70 6f 73 | 69 74 69 6f 6e 20 62 65 |tial pos|ition be|
|00005530| 63 61 75 73 65 0a 74 68 | 65 20 62 6c 6f 63 6b 20 |cause.th|e block |
|00005540| 61 75 74 6f 6d 61 74 69 | 63 61 6c 6c 79 20 73 68 |automati|cally sh|
|00005550| 72 69 6e 6b 73 20 6f 72 | 20 67 72 6f 77 73 20 74 |rinks or| grows t|
|00005560| 6f 20 66 69 74 2e 29 0a | 5c 65 6e 64 7b 66 75 6e |o fit.).|\end{fun|
|00005570| 63 64 65 73 63 7d 0a 0a | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00005580| 75 6e 63 64 65 73 63 7d | 7b 67 65 74 74 65 78 74 |uncdesc}|{gettext|
|00005590| 7d 7b 7d 0a 52 65 74 75 | 72 6e 20 74 68 65 20 65 |}{}.Retu|rn the e|
|000055a0| 6e 74 69 72 65 20 74 65 | 78 74 20 62 75 66 66 65 |ntire te|xt buffe|
|000055b0| 72 2e 0a 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |r..\end{|funcdesc|
|000055c0| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|000055d0| 73 63 7d 7b 6d 6f 76 65 | 7d 7b 72 65 63 74 7d 0a |sc}{move|}{rect}.|
|000055e0| 53 70 65 63 69 66 79 20 | 61 20 6e 65 77 20 70 6f |Specify |a new po|
|000055f0| 73 69 74 69 6f 6e 20 66 | 6f 72 20 74 68 65 20 74 |sition f|or the t|
|00005600| 65 78 74 2d 65 64 69 74 | 20 62 6c 6f 63 6b 20 69 |ext-edit| block i|
|00005610| 6e 20 74 68 65 20 64 6f | 63 75 6d 65 6e 74 2e 0a |n the do|cument..|
|00005620| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a 0a |\end{fun|cdesc}..|
|00005630| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00005640| 7b 72 65 70 6c 61 63 65 | 7d 7b 73 74 72 7d 0a 52 |{replace|}{str}.R|
|00005650| 65 70 6c 61 63 65 20 74 | 68 65 20 74 65 78 74 20 |eplace t|he text |
|00005660| 69 6e 20 74 68 65 20 66 | 6f 63 75 73 20 62 79 20 |in the f|ocus by |
|00005670| 74 68 65 20 67 69 76 65 | 6e 20 73 74 72 69 6e 67 |the give|n string|
|00005680| 2e 0a 54 68 65 20 6e 65 | 77 20 66 6f 63 75 73 20 |..The ne|w focus |
|00005690| 69 73 20 61 6e 20 69 6e | 73 65 72 74 20 70 6f 69 |is an in|sert poi|
|000056a0| 6e 74 20 61 74 20 74 68 | 65 20 65 6e 64 20 6f 66 |nt at th|e end of|
|000056b0| 20 74 68 65 20 73 74 72 | 69 6e 67 2e 0a 5c 65 6e | the str|ing..\en|
|000056c0| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0a 0a 5c 62 65 |d{funcde|sc}..\be|
|000056d0| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 73 65 |gin{func|desc}{se|
|000056e0| 74 66 6f 63 75 73 7d 7b | 69 5c 2c 20 6a 7d 0a 53 |tfocus}{|i\, j}.S|
|000056f0| 70 65 63 69 66 79 20 74 | 68 65 20 6e 65 77 20 66 |pecify t|he new f|
|00005700| 6f 63 75 73 2e 0a 4f 75 | 74 2d 6f 66 2d 62 6f 75 |ocus..Ou|t-of-bou|
|00005710| 6e 64 73 20 76 61 6c 75 | 65 73 20 61 72 65 20 73 |nds valu|es are s|
|00005720| 69 6c 65 6e 74 6c 79 20 | 63 6c 69 70 70 65 64 2e |ilently |clipped.|
|00005730| 0a 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0a |.\end{fu|ncdesc}.|
|00005740| 0a 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00005750| 7d 7b 73 65 74 74 65 78 | 74 7d 7b 73 74 72 7d 0a |}{settex|t}{str}.|
|00005760| 52 65 70 6c 61 63 65 20 | 74 68 65 20 65 6e 74 69 |Replace |the enti|
|00005770| 72 65 20 74 65 78 74 20 | 62 75 66 66 65 72 20 62 |re text |buffer b|
|00005780| 79 20 74 68 65 20 67 69 | 76 65 6e 20 73 74 72 69 |y the gi|ven stri|
|00005790| 6e 67 20 61 6e 64 20 73 | 65 74 20 74 68 65 20 66 |ng and s|et the f|
|000057a0| 6f 63 75 73 0a 74 6f 20 | 5c 63 6f 64 65 7b 28 30 |ocus.to |\code{(0|
|000057b0| 2c 20 30 29 7d 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |, 0)}..\|end{func|
|000057c0| 64 65 73 63 7d 0a 0a 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|000057d0| 6e 63 64 65 73 63 7d 7b | 73 65 74 76 69 65 77 7d |ncdesc}{|setview}|
|000057e0| 7b 72 65 63 74 7d 0a 53 | 65 74 20 74 68 65 20 76 |{rect}.S|et the v|
|000057f0| 69 65 77 20 72 65 63 74 | 61 6e 67 6c 65 20 74 6f |iew rect|angle to|
|00005800| 20 5c 76 61 72 7b 72 65 | 63 74 7d 2e 20 20 49 66 | \var{re|ct}. If|
|00005810| 20 5c 76 61 72 7b 72 65 | 63 74 7d 20 69 73 20 5c | \var{re|ct} is \|
|00005820| 63 6f 64 65 7b 4e 6f 6e | 65 7d 2c 0a 76 69 65 77 |code{Non|e},.view|
|00005830| 69 6e 67 20 6d 6f 64 65 | 20 69 73 20 72 65 73 65 |ing mode| is rese|
|00005840| 74 2e 20 20 49 6e 20 76 | 69 65 77 69 6e 67 20 6d |t. In v|iewing m|
|00005850| 6f 64 65 2c 20 61 6c 6c | 20 6f 75 74 70 75 74 20 |ode, all| output |
|00005860| 66 72 6f 6d 20 74 68 65 | 20 74 65 78 74 2d 65 64 |from the| text-ed|
|00005870| 69 74 0a 6f 62 6a 65 63 | 74 20 69 73 20 63 6c 69 |it.objec|t is cli|
|00005880| 70 70 65 64 20 74 6f 20 | 74 68 65 20 76 69 65 77 |pped to |the view|
|00005890| 69 6e 67 20 72 65 63 74 | 61 6e 67 6c 65 2e 20 20 |ing rect|angle. |
|000058a0| 54 68 69 73 20 6d 61 79 | 20 62 65 20 75 73 65 66 |This may| be usef|
|000058b0| 75 6c 20 74 6f 0a 69 6d | 70 6c 65 6d 65 6e 74 20 |ul to.im|plement |
|000058c0| 79 6f 75 72 20 6f 77 6e | 20 73 63 72 6f 6c 6c 69 |your own| scrolli|
|000058d0| 6e 67 20 74 65 78 74 20 | 73 75 62 77 69 6e 64 6f |ng text |subwindo|
|000058e0| 77 2e 0a 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |w..\end{|funcdesc|
|000058f0| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|00005900| 73 63 7d 7b 63 6c 6f 73 | 65 7d 7b 7d 0a 44 69 73 |sc}{clos|e}{}.Dis|
|00005910| 63 61 72 64 20 74 68 65 | 20 74 65 78 74 2d 65 64 |card the| text-ed|
|00005920| 69 74 20 6f 62 6a 65 63 | 74 2e 20 20 49 74 20 73 |it objec|t. It s|
|00005930| 68 6f 75 6c 64 20 6e 6f | 74 20 62 65 20 75 73 65 |hould no|t be use|
|00005940| 64 20 61 67 61 69 6e 2e | 0a 5c 65 6e 64 7b 66 75 |d again.|.\end{fu|
|00005950| 6e 63 64 65 73 63 7d 0a | 0a 5c 73 75 62 73 65 63 |ncdesc}.|.\subsec|
|00005960| 74 69 6f 6e 7b 45 78 61 | 6d 70 6c 65 7d 0a 5c 6e |tion{Exa|mple}.\n|
|00005970| 6f 64 65 6e 61 6d 65 7b | 53 54 44 57 49 4e 20 45 |odename{|STDWIN E|
|00005980| 78 61 6d 70 6c 65 7d 0a | 0a 48 65 72 65 20 69 73 |xample}.|.Here is|
|00005990| 20 61 20 6d 69 6e 69 6d | 61 6c 20 65 78 61 6d 70 | a minim|al examp|
|000059a0| 6c 65 20 6f 66 20 75 73 | 69 6e 67 20 53 54 44 57 |le of us|ing STDW|
|000059b0| 49 4e 20 69 6e 20 50 79 | 74 68 6f 6e 2e 0a 49 74 |IN in Py|thon..It|
|000059c0| 20 63 72 65 61 74 65 73 | 20 61 20 77 69 6e 64 6f | creates| a windo|
|000059d0| 77 20 61 6e 64 20 64 72 | 61 77 73 20 74 68 65 20 |w and dr|aws the |
|000059e0| 73 74 72 69 6e 67 20 60 | 60 48 65 6c 6c 6f 20 77 |string `|`Hello w|
|000059f0| 6f 72 6c 64 27 27 20 69 | 6e 20 74 68 65 20 74 6f |orld'' i|n the to|
|00005a00| 70 0a 6c 65 66 74 20 63 | 6f 72 6e 65 72 20 6f 66 |p.left c|orner of|
|00005a10| 20 74 68 65 20 77 69 6e | 64 6f 77 2e 0a 54 68 65 | the win|dow..The|
|00005a20| 20 77 69 6e 64 6f 77 20 | 77 69 6c 6c 20 62 65 20 | window |will be |
|00005a30| 63 6f 72 72 65 63 74 6c | 79 20 72 65 64 72 61 77 |correctl|y redraw|
|00005a40| 6e 20 77 68 65 6e 20 63 | 6f 76 65 72 65 64 20 61 |n when c|overed a|
|00005a50| 6e 64 20 72 65 2d 65 78 | 70 6f 73 65 64 2e 0a 54 |nd re-ex|posed..T|
|00005a60| 68 65 20 70 72 6f 67 72 | 61 6d 20 71 75 69 74 73 |he progr|am quits|
|00005a70| 20 77 68 65 6e 20 74 68 | 65 20 63 6c 6f 73 65 20 | when th|e close |
|00005a80| 69 63 6f 6e 20 6f 72 20 | 6d 65 6e 75 20 69 74 65 |icon or |menu ite|
|00005a90| 6d 20 69 73 20 72 65 71 | 75 65 73 74 65 64 2e 0a |m is req|uested..|
|00005aa0| 0a 5c 62 63 6f 64 65 5c | 62 65 67 69 6e 7b 76 65 |.\bcode\|begin{ve|
|00005ab0| 72 62 61 74 69 6d 7d 0a | 69 6d 70 6f 72 74 20 73 |rbatim}.|import s|
|00005ac0| 74 64 77 69 6e 0a 66 72 | 6f 6d 20 73 74 64 77 69 |tdwin.fr|om stdwi|
|00005ad0| 6e 65 76 65 6e 74 73 20 | 69 6d 70 6f 72 74 20 2a |nevents |import *|
|00005ae0| 0a 0a 64 65 66 20 6d 61 | 69 6e 28 29 3a 0a 20 20 |..def ma|in():. |
|00005af0| 20 20 6d 79 77 69 6e 20 | 3d 20 73 74 64 77 69 6e | mywin |= stdwin|
|00005b00| 2e 6f 70 65 6e 28 27 48 | 65 6c 6c 6f 27 29 0a 20 |.open('H|ello'). |
|00005b10| 20 20 20 23 0a 20 20 20 | 20 77 68 69 6c 65 20 31 | #. | while 1|
|00005b20| 3a 0a 20 20 20 20 20 20 | 20 20 28 74 79 70 65 2c |:. | (type,|
|00005b30| 20 77 69 6e 2c 20 64 65 | 74 61 69 6c 29 20 3d 20 | win, de|tail) = |
|00005b40| 73 74 64 77 69 6e 2e 67 | 65 74 65 76 65 6e 74 28 |stdwin.g|etevent(|
|00005b50| 29 0a 20 20 20 20 20 20 | 20 20 69 66 20 74 79 70 |). | if typ|
|00005b60| 65 20 3d 3d 20 57 45 5f | 44 52 41 57 3a 0a 20 20 |e == WE_|DRAW:. |
|00005b70| 20 20 20 20 20 20 20 20 | 20 20 64 72 61 77 20 3d | | draw =|
|00005b80| 20 77 69 6e 2e 62 65 67 | 69 6e 64 72 61 77 69 6e | win.beg|indrawin|
|00005b90| 67 28 29 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |g(). | |
|00005ba0| 64 72 61 77 2e 74 65 78 | 74 28 28 30 2c 20 30 29 |draw.tex|t((0, 0)|
|00005bb0| 2c 20 27 48 65 6c 6c 6f | 2c 20 77 6f 72 6c 64 27 |, 'Hello|, world'|
|00005bc0| 29 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 64 65 |). | de|
|00005bd0| 6c 20 64 72 61 77 0a 20 | 20 20 20 20 20 20 20 65 |l draw. | e|
|00005be0| 6c 69 66 20 74 79 70 65 | 20 3d 3d 20 57 45 5f 43 |lif type| == WE_C|
|00005bf0| 4c 4f 53 45 3a 0a 20 20 | 20 20 20 20 20 20 20 20 |LOSE:. | |
|00005c00| 20 20 62 72 65 61 6b 0a | 0a 6d 61 69 6e 28 29 0a | break.|.main().|
|00005c10| 5c 65 6e 64 7b 76 65 72 | 62 61 74 69 6d 7d 5c 65 |\end{ver|batim}\e|
|00005c20| 63 6f 64 65 0a 0a 5c 73 | 65 63 74 69 6f 6e 7b 53 |code..\s|ection{S|
|00005c30| 74 61 6e 64 61 72 64 20 | 4d 6f 64 75 6c 65 20 5c |tandard |Module \|
|00005c40| 73 65 63 74 63 6f 64 65 | 7b 73 74 64 77 69 6e 65 |sectcode|{stdwine|
|00005c50| 76 65 6e 74 73 7d 7d 0a | 5c 73 74 6d 6f 64 69 6e |vents}}.|\stmodin|
|00005c60| 64 65 78 7b 73 74 64 77 | 69 6e 65 76 65 6e 74 73 |dex{stdw|inevents|
|00005c70| 7d 0a 0a 54 68 69 73 20 | 6d 6f 64 75 6c 65 20 64 |}..This |module d|
|00005c80| 65 66 69 6e 65 73 20 63 | 6f 6e 73 74 61 6e 74 73 |efines c|onstants|
|00005c90| 20 75 73 65 64 20 62 79 | 20 53 54 44 57 49 4e 20 | used by| STDWIN |
|00005ca0| 66 6f 72 20 65 76 65 6e | 74 20 74 79 70 65 73 0a |for even|t types.|
|00005cb0| 28 5c 63 6f 64 65 7b 57 | 45 5f 41 43 54 49 56 41 |(\code{W|E_ACTIVA|
|00005cc0| 54 45 7d 20 65 74 63 2e | 29 2c 20 63 6f 6d 6d 61 |TE} etc.|), comma|
|00005cd0| 6e 64 20 63 6f 64 65 73 | 20 28 5c 63 6f 64 65 7b |nd codes| (\code{|
|00005ce0| 57 43 5f 4c 45 46 54 7d | 20 65 74 63 2e 29 0a 61 |WC_LEFT}| etc.).a|
|00005cf0| 6e 64 20 73 65 6c 65 63 | 74 69 6f 6e 20 74 79 70 |nd selec|tion typ|
|00005d00| 65 73 20 28 5c 63 6f 64 | 65 7b 57 53 5f 50 52 49 |es (\cod|e{WS_PRI|
|00005d10| 4d 41 52 59 7d 20 65 74 | 63 2e 29 2e 0a 52 65 61 |MARY} et|c.)..Rea|
|00005d20| 64 20 74 68 65 20 66 69 | 6c 65 20 66 6f 72 20 64 |d the fi|le for d|
|00005d30| 65 74 61 69 6c 73 2e 0a | 53 75 67 67 65 73 74 65 |etails..|Suggeste|
|00005d40| 64 20 75 73 61 67 65 20 | 69 73 0a 0a 5c 62 63 6f |d usage |is..\bco|
|00005d50| 64 65 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |de\begin|{verbati|
|00005d60| 6d 7d 0a 3e 3e 3e 20 66 | 72 6f 6d 20 73 74 64 77 |m}.>>> f|rom stdw|
|00005d70| 69 6e 65 76 65 6e 74 73 | 20 69 6d 70 6f 72 74 20 |inevents| import |
|00005d80| 2a 0a 3e 3e 3e 20 0a 5c | 65 6e 64 7b 76 65 72 62 |*.>>> .\|end{verb|
|00005d90| 61 74 69 6d 7d 5c 65 63 | 6f 64 65 0a 0a 5c 73 65 |atim}\ec|ode..\se|
|00005da0| 63 74 69 6f 6e 7b 53 74 | 61 6e 64 61 72 64 20 4d |ction{St|andard M|
|00005db0| 6f 64 75 6c 65 20 5c 73 | 65 63 74 63 6f 64 65 7b |odule \s|ectcode{|
|00005dc0| 72 65 63 74 7d 7d 0a 5c | 73 74 6d 6f 64 69 6e 64 |rect}}.\|stmodind|
|00005dd0| 65 78 7b 72 65 63 74 7d | 0a 0a 54 68 69 73 20 6d |ex{rect}|..This m|
|00005de0| 6f 64 75 6c 65 20 63 6f | 6e 74 61 69 6e 73 20 75 |odule co|ntains u|
|00005df0| 73 65 66 75 6c 20 6f 70 | 65 72 61 74 69 6f 6e 73 |seful op|erations|
|00005e00| 20 6f 6e 20 72 65 63 74 | 61 6e 67 6c 65 73 2e 0a | on rect|angles..|
|00005e10| 41 20 72 65 63 74 61 6e | 67 6c 65 20 69 73 20 64 |A rectan|gle is d|
|00005e20| 65 66 69 6e 65 64 20 61 | 73 20 69 6e 20 6d 6f 64 |efined a|s in mod|
|00005e30| 75 6c 65 0a 5c 63 6f 64 | 65 7b 73 74 64 77 69 6e |ule.\cod|e{stdwin|
|00005e40| 7d 3a 0a 61 20 70 61 69 | 72 20 6f 66 20 70 6f 69 |}:.a pai|r of poi|
|00005e50| 6e 74 73 2c 20 77 68 65 | 72 65 20 61 20 70 6f 69 |nts, whe|re a poi|
|00005e60| 6e 74 20 69 73 20 61 20 | 70 61 69 72 20 6f 66 20 |nt is a |pair of |
|00005e70| 69 6e 74 65 67 65 72 73 | 2e 0a 46 6f 72 20 65 78 |integers|..For ex|
|00005e80| 61 6d 70 6c 65 2c 20 74 | 68 65 20 72 65 63 74 61 |ample, t|he recta|
|00005e90| 6e 67 6c 65 0a 0a 5c 62 | 63 6f 64 65 5c 62 65 67 |ngle..\b|code\beg|
|00005ea0| 69 6e 7b 76 65 72 62 61 | 74 69 6d 7d 0a 28 31 30 |in{verba|tim}.(10|
|00005eb0| 2c 20 32 30 29 2c 20 28 | 39 30 2c 20 38 30 29 0a |, 20), (|90, 80).|
|00005ec0| 5c 65 6e 64 7b 76 65 72 | 62 61 74 69 6d 7d 5c 65 |\end{ver|batim}\e|
|00005ed0| 63 6f 64 65 0a 0a 69 73 | 20 61 20 72 65 63 74 61 |code..is| a recta|
|00005ee0| 6e 67 6c 65 20 77 68 6f | 73 65 20 6c 65 66 74 2c |ngle who|se left,|
|00005ef0| 20 74 6f 70 2c 20 72 69 | 67 68 74 20 61 6e 64 20 | top, ri|ght and |
|00005f00| 62 6f 74 74 6f 6d 20 65 | 64 67 65 73 20 61 72 65 |bottom e|dges are|
|00005f10| 20 31 30 2c 20 32 30 2c | 20 39 30 0a 61 6e 64 20 | 10, 20,| 90.and |
|00005f20| 38 30 2c 20 72 65 73 70 | 65 63 74 69 76 65 6c 79 |80, resp|ectively|
|00005f30| 2e 0a 4e 6f 74 65 20 74 | 68 61 74 20 74 68 65 20 |..Note t|hat the |
|00005f40| 70 6f 73 69 74 69 76 65 | 20 76 65 72 74 69 63 61 |positive| vertica|
|00005f50| 6c 20 61 78 69 73 20 70 | 6f 69 6e 74 73 20 64 6f |l axis p|oints do|
|00005f60| 77 6e 20 28 61 73 20 69 | 6e 0a 5c 63 6f 64 65 7b |wn (as i|n.\code{|
|00005f70| 73 74 64 77 69 6e 7d 29 | 2e 0a 0a 54 68 65 20 6d |stdwin})|...The m|
|00005f80| 6f 64 75 6c 65 20 64 65 | 66 69 6e 65 73 20 74 68 |odule de|fines th|
|00005f90| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 6f 62 6a 65 |e follow|ing obje|
|00005fa0| 63 74 73 3a 0a 0a 5c 72 | 65 6e 65 77 63 6f 6d 6d |cts:..\r|enewcomm|
|00005fb0| 61 6e 64 7b 5c 69 6e 64 | 65 78 73 75 62 69 74 65 |and{\ind|exsubite|
|00005fc0| 6d 7d 7b 28 69 6e 20 6d | 6f 64 75 6c 65 20 72 65 |m}{(in m|odule re|
|00005fd0| 63 74 29 7d 0a 5c 62 65 | 67 69 6e 7b 65 78 63 64 |ct)}.\be|gin{excd|
|00005fe0| 65 73 63 7d 7b 65 72 72 | 6f 72 7d 0a 54 68 65 20 |esc}{err|or}.The |
|00005ff0| 65 78 63 65 70 74 69 6f | 6e 20 72 61 69 73 65 64 |exceptio|n raised|
|00006000| 20 62 79 20 66 75 6e 63 | 74 69 6f 6e 73 20 69 6e | by func|tions in|
|00006010| 20 74 68 69 73 20 6d 6f | 64 75 6c 65 20 77 68 65 | this mo|dule whe|
|00006020| 6e 20 74 68 65 79 20 64 | 65 74 65 63 74 20 61 6e |n they d|etect an|
|00006030| 0a 65 72 72 6f 72 2e 0a | 54 68 65 20 65 78 63 65 |.error..|The exce|
|00006040| 70 74 69 6f 6e 20 61 72 | 67 75 6d 65 6e 74 20 69 |ption ar|gument i|
|00006050| 73 20 61 20 73 74 72 69 | 6e 67 20 64 65 73 63 72 |s a stri|ng descr|
|00006060| 69 62 69 6e 67 20 74 68 | 65 20 70 72 6f 62 6c 65 |ibing th|e proble|
|00006070| 6d 20 69 6e 20 6d 6f 72 | 65 0a 64 65 74 61 69 6c |m in mor|e.detail|
|00006080| 2e 0a 5c 65 6e 64 7b 65 | 78 63 64 65 73 63 7d 0a |..\end{e|xcdesc}.|
|00006090| 0a 5c 62 65 67 69 6e 7b | 64 61 74 61 64 65 73 63 |.\begin{|datadesc|
|000060a0| 7d 7b 65 6d 70 74 79 7d | 0a 54 68 65 20 72 65 63 |}{empty}|.The rec|
|000060b0| 74 61 6e 67 6c 65 20 72 | 65 74 75 72 6e 65 64 20 |tangle r|eturned |
|000060c0| 77 68 65 6e 20 73 6f 6d | 65 20 6f 70 65 72 61 74 |when som|e operat|
|000060d0| 69 6f 6e 73 20 72 65 74 | 75 72 6e 20 61 6e 20 65 |ions ret|urn an e|
|000060e0| 6d 70 74 79 20 72 65 73 | 75 6c 74 2e 0a 54 68 69 |mpty res|ult..Thi|
|000060f0| 73 20 6d 61 6b 65 73 20 | 69 74 20 70 6f 73 73 69 |s makes |it possi|
|00006100| 62 6c 65 20 74 6f 20 71 | 75 69 63 6b 6c 79 20 63 |ble to q|uickly c|
|00006110| 68 65 63 6b 20 77 68 65 | 74 68 65 72 20 61 20 72 |heck whe|ther a r|
|00006120| 65 73 75 6c 74 20 69 73 | 20 65 6d 70 74 79 3a 0a |esult is| empty:.|
|00006130| 0a 5c 62 63 6f 64 65 5c | 62 65 67 69 6e 7b 76 65 |.\bcode\|begin{ve|
|00006140| 72 62 61 74 69 6d 7d 0a | 3e 3e 3e 20 69 6d 70 6f |rbatim}.|>>> impo|
|00006150| 72 74 20 72 65 63 74 0a | 3e 3e 3e 20 72 31 20 3d |rt rect.|>>> r1 =|
|00006160| 20 28 31 30 2c 20 32 30 | 29 2c 20 28 39 30 2c 20 | (10, 20|), (90, |
|00006170| 38 30 29 0a 3e 3e 3e 20 | 72 32 20 3d 20 28 30 2c |80).>>> |r2 = (0,|
|00006180| 20 30 29 2c 20 28 31 30 | 2c 20 32 30 29 0a 3e 3e | 0), (10|, 20).>>|
|00006190| 3e 20 72 33 20 3d 20 72 | 65 63 74 2e 69 6e 74 65 |> r3 = r|ect.inte|
|000061a0| 72 73 65 63 74 28 5b 72 | 31 2c 20 72 32 5d 29 0a |rsect([r|1, r2]).|
|000061b0| 3e 3e 3e 20 69 66 20 72 | 33 20 69 73 20 72 65 63 |>>> if r|3 is rec|
|000061c0| 74 2e 65 6d 70 74 79 3a | 20 70 72 69 6e 74 20 27 |t.empty:| print '|
|000061d0| 45 6d 70 74 79 20 69 6e | 74 65 72 73 65 63 74 69 |Empty in|tersecti|
|000061e0| 6f 6e 27 0a 45 6d 70 74 | 79 20 69 6e 74 65 72 73 |on'.Empt|y inters|
|000061f0| 65 63 74 69 6f 6e 0a 3e | 3e 3e 20 0a 5c 65 6e 64 |ection.>|>> .\end|
|00006200| 7b 76 65 72 62 61 74 69 | 6d 7d 5c 65 63 6f 64 65 |{verbati|m}\ecode|
|00006210| 0a 5c 65 6e 64 7b 64 61 | 74 61 64 65 73 63 7d 0a |.\end{da|tadesc}.|
|00006220| 0a 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00006230| 7d 7b 69 73 5f 65 6d 70 | 74 79 7d 7b 72 7d 0a 52 |}{is_emp|ty}{r}.R|
|00006240| 65 74 75 72 6e 73 20 74 | 72 75 65 20 69 66 20 74 |eturns t|rue if t|
|00006250| 68 65 20 67 69 76 65 6e | 20 72 65 63 74 61 6e 67 |he given| rectang|
|00006260| 6c 65 20 69 73 20 65 6d | 70 74 79 2e 0a 41 20 72 |le is em|pty..A r|
|00006270| 65 63 74 61 6e 67 6c 65 | 0a 5c 63 6f 64 65 7b 28 |ectangle|.\code{(|
|00006280| 5c 76 61 72 7b 6c 65 66 | 74 7d 2c 20 5c 76 61 72 |\var{lef|t}, \var|
|00006290| 7b 74 6f 70 7d 29 2c 20 | 28 5c 76 61 72 7b 72 69 |{top}), |(\var{ri|
|000062a0| 67 68 74 7d 2c 20 5c 76 | 61 72 7b 62 6f 74 74 6f |ght}, \v|ar{botto|
|000062b0| 6d 7d 29 7d 0a 69 73 20 | 65 6d 70 74 79 20 69 66 |m})}.is |empty if|
|000062c0| 0a 5c 69 66 74 65 78 69 | 0a 5c 63 6f 64 65 7b 5c |.\iftexi|.\code{\|
|000062d0| 76 61 72 7b 6c 65 66 74 | 7d 20 3e 3d 20 5c 76 61 |var{left|} >= \va|
|000062e0| 72 7b 72 69 67 68 74 7d | 7d 20 6f 72 20 5c 63 6f |r{right}|} or \co|
|000062f0| 64 65 7b 5c 76 61 72 7b | 74 6f 70 7d 20 3d 3e 20 |de{\var{|top} => |
|00006300| 5c 76 61 72 7b 62 6f 74 | 74 6f 6d 7d 7d 2e 0a 5c |\var{bot|tom}}..\|
|00006310| 65 6c 73 65 0a 24 5c 76 | 61 72 7b 6c 65 66 74 7d |else.$\v|ar{left}|
|00006320| 20 5c 67 65 71 20 5c 76 | 61 72 7b 72 69 67 68 74 | \geq \v|ar{right|
|00006330| 7d 24 20 6f 72 20 24 5c | 76 61 72 7b 74 6f 70 7d |}$ or $\|var{top}|
|00006340| 20 5c 67 65 71 20 5c 76 | 61 72 7b 62 6f 74 74 6f | \geq \v|ar{botto|
|00006350| 6d 7d 24 2e 0a 25 25 4a | 48 58 58 58 7b 5c 65 6d |m}$..%%J|HXXX{\em|
|00006360| 20 6c 65 66 74 7e 24 5c | 67 65 71 24 7e 72 69 67 | left~$\|geq$~rig|
|00006370| 68 74 7d 20 6f 72 20 7b | 5c 65 6d 20 74 6f 70 7e |ht} or {|\em top~|
|00006380| 24 5c 6c 65 71 24 7e 62 | 6f 74 74 6f 6d 7d 2e 0a |$\leq$~b|ottom}..|
|00006390| 5c 66 69 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |\fi.\end|{funcdes|
|000063a0| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|000063b0| 65 73 63 7d 7b 69 6e 74 | 65 72 73 65 63 74 7d 7b |esc}{int|ersect}{|
|000063c0| 6c 69 73 74 7d 0a 52 65 | 74 75 72 6e 73 20 74 68 |list}.Re|turns th|
|000063d0| 65 20 69 6e 74 65 72 73 | 65 63 74 69 6f 6e 20 6f |e inters|ection o|
|000063e0| 66 20 61 6c 6c 20 72 65 | 63 74 61 6e 67 6c 65 73 |f all re|ctangles|
|000063f0| 20 69 6e 20 74 68 65 20 | 6c 69 73 74 20 61 72 67 | in the |list arg|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.