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: Chap2.tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Corel 10 Texture (image/corel10Texture)
| ext
| Unsupported |
1%
| dexvert
| Croteam texture file (image/croteamTextureFile)
| ext
| Unsupported |
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)
| |
100%
| xdgMime
| text/x-matlab
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 0a 25 20 43 68 61 70 | 74 65 72 20 42 61 73 69 |%.% Chap|ter Basi|
|00000010| 63 0a 25 0a 25 20 20 20 | 20 20 20 20 20 20 20 20 |c.%.% | |
|00000020| 41 75 74 68 6f 72 3a 20 | 45 72 69 63 6b 20 47 61 |Author: |Erick Ga|
|00000030| 6c 6c 65 73 69 6f 20 5b | 65 67 40 6b 61 6f 6c 69 |llesio [|eg@kaoli|
|00000040| 6e 2e 75 6e 69 63 65 2e | 66 72 5d 0a 25 20 20 20 |n.unice.|fr].% |
|00000050| 20 43 72 65 61 74 69 6f | 6e 20 64 61 74 65 3a 20 | Creatio|n date: |
|00000060| 20 36 2d 4a 61 6e 2d 31 | 39 39 33 20 31 32 3a 33 | 6-Jan-1|993 12:3|
|00000070| 31 0a 25 20 4c 61 73 74 | 20 66 69 6c 65 20 75 70 |1.% Last| file up|
|00000080| 64 61 74 65 3a 20 32 30 | 2d 4d 61 79 2d 31 39 39 |date: 20|-May-199|
|00000090| 35 20 31 33 3a 31 33 0a | 0a 0a 5c 63 68 61 70 74 |5 13:13.|..\chapt|
|000000a0| 65 72 7b 42 61 73 69 63 | 20 77 69 64 67 65 74 73 |er{Basic| widgets|
|000000b0| 7d 0a 0a 54 68 69 73 20 | 63 68 61 70 74 65 72 20 |}..This |chapter |
|000000c0| 69 73 20 64 65 76 6f 74 | 65 64 20 74 6f 20 74 68 |is devot|ed to th|
|000000d0| 65 20 73 69 6d 70 6c 65 | 73 74 20 77 69 64 67 65 |e simple|st widge|
|000000e0| 74 73 20 6f 66 20 74 68 | 65 20 7b 5c 73 74 6b 6c |ts of th|e {\stkl|
|000000f0| 6f 73 7d 20 70 61 63 6b | 61 67 65 2e 0a 49 6e 20 |os} pack|age..In |
|00000100| 66 61 63 74 2c 20 61 6c | 6c 20 74 68 65 20 54 6b |fact, al|l the Tk|
|00000110| 20 77 69 64 67 65 74 73 | 2c 20 65 78 63 65 70 74 | widgets|, except|
|00000120| 20 74 68 65 20 7b 5c 65 | 6d 20 63 61 6e 76 61 73 | the {\e|m canvas|
|00000130| 7d 20 61 6e 64 20 7b 5c | 65 6d 20 74 65 78 74 7d |} and {\|em text}|
|00000140| 20 77 69 64 67 65 74 73 | 2c 0a 61 72 65 20 70 72 | widgets|,.are pr|
|00000150| 65 73 65 6e 74 65 64 20 | 68 65 72 65 2e 0a 0a 5c |esented |here...\|
|00000160| 73 65 63 74 69 6f 6e 7b | 49 6e 74 72 6f 64 75 63 |section{|Introduc|
|00000170| 74 69 6f 6e 7d 0a 0a 5c | 73 75 62 73 65 63 74 69 |tion}..\|subsecti|
|00000180| 6f 6e 7b 41 20 73 69 6d | 70 6c 65 20 69 6e 74 65 |on{A sim|ple inte|
|00000190| 72 66 61 63 65 7d 0a 0a | 5c 73 75 62 73 75 62 73 |rface}..|\subsubs|
|000001a0| 65 63 74 69 6f 6e 7b 44 | 65 66 69 6e 69 6e 67 20 |ection{D|efining |
|000001b0| 74 68 65 20 77 69 64 67 | 65 74 73 7d 0a 42 65 66 |the widg|ets}.Bef|
|000001c0| 6f 72 65 20 64 65 74 61 | 69 6c 69 6e 67 20 61 6c |ore deta|iling al|
|000001d0| 6c 20 74 68 65 20 73 69 | 6d 70 6c 65 20 77 69 64 |l the si|mple wid|
|000001e0| 67 65 74 73 20 6f 66 20 | 74 68 65 20 54 6b 20 6c |gets of |the Tk l|
|000001f0| 69 62 72 61 72 79 2c 20 | 77 65 20 77 69 6c 6c 20 |ibrary, |we will |
|00000200| 73 65 65 20 68 6f 77 20 | 74 6f 0a 62 75 69 6c 64 |see how |to.build|
|00000210| 20 74 68 65 20 73 69 6d | 70 6c 65 20 69 6e 74 65 | the sim|ple inte|
|00000220| 72 66 61 63 65 20 77 68 | 69 63 68 20 69 73 20 73 |rface wh|ich is s|
|00000230| 68 6f 77 6e 20 69 6e 20 | 46 69 67 75 72 65 7e 5c |hown in |Figure~\|
|00000240| 72 65 66 7b 66 69 67 2d | 73 69 6d 70 6c 65 2d 69 |ref{fig-|simple-i|
|00000250| 6e 74 65 72 66 61 63 65 | 7d 2e 20 0a 5c 62 65 67 |nterface|}. .\beg|
|00000260| 69 6e 7b 66 69 67 75 72 | 65 7d 0a 5c 63 65 6e 74 |in{figur|e}.\cent|
|00000270| 65 72 6c 69 6e 65 7b 5c | 65 70 73 66 69 67 7b 66 |erline{\|epsfig{f|
|00000280| 69 6c 65 3d 42 61 73 69 | 63 2d 46 69 67 2d 31 2e |ile=Basi|c-Fig-1.|
|00000290| 70 73 7d 7d 0a 5c 63 61 | 70 74 69 6f 6e 7b 41 20 |ps}}.\ca|ption{A |
|000002a0| 73 69 6d 70 6c 65 20 69 | 6e 74 65 72 66 61 63 65 |simple i|nterface|
|000002b0| 7d 0a 5c 6c 61 62 65 6c | 7b 66 69 67 2d 73 69 6d |}.\label|{fig-sim|
|000002c0| 70 6c 65 2d 69 6e 74 65 | 72 66 61 63 65 7d 0a 5c |ple-inte|rface}.\|
|000002d0| 65 6e 64 7b 66 69 67 75 | 72 65 7d 0a 54 68 69 73 |end{figu|re}.This|
|000002e0| 20 69 6e 74 65 72 66 61 | 63 65 20 69 73 20 63 6f | interfa|ce is co|
|000002f0| 6d 70 6f 73 65 64 20 6f | 66 20 74 68 72 65 65 20 |mposed o|f three |
|00000300| 6d 61 69 6e 20 63 6f 6d | 70 6f 6e 65 6e 74 73 3a |main com|ponents:|
|00000310| 20 0a 5c 62 65 67 69 6e | 7b 65 6e 75 6d 65 72 61 | .\begin|{enumera|
|00000320| 74 65 7d 0a 5c 69 74 65 | 6d 20 61 20 6c 61 62 65 |te}.\ite|m a labe|
|00000330| 6c 20 77 68 69 63 68 20 | 69 73 20 73 69 74 75 61 |l which |is situa|
|00000340| 74 65 64 20 61 74 20 74 | 6f 70 0a 5c 69 74 65 6d |ted at t|op.\item|
|00000350| 20 61 20 66 72 61 6d 65 | 20 77 68 69 63 68 20 69 | a frame| which i|
|00000360| 73 20 69 74 73 65 6c 66 | 20 63 6f 6e 73 74 69 74 |s itself| constit|
|00000370| 75 74 65 64 20 6f 66 20 | 74 77 6f 20 63 6f 6d 70 |uted of |two comp|
|00000380| 6f 6e 65 6e 74 73 3a 20 | 0a 5c 62 65 67 69 6e 7b |onents: |.\begin{|
|00000390| 65 6e 75 6d 65 72 61 74 | 65 7d 0a 5c 69 74 65 6d |enumerat|e}.\item|
|000003a0| 20 61 20 6c 69 73 74 62 | 6f 78 2c 20 61 6e 64 0a | a listb|ox, and.|
|000003b0| 5c 69 74 65 6d 20 61 20 | 73 63 72 6f 6c 6c 62 61 |\item a |scrollba|
|000003c0| 72 0a 5c 65 6e 64 7b 65 | 6e 75 6d 65 72 61 74 65 |r.\end{e|numerate|
|000003d0| 7d 0a 5c 69 74 65 6d 20 | 61 20 60 60 71 75 69 74 |}.\item |a ``quit|
|000003e0| 27 27 20 62 75 74 74 6f | 6e 0a 5c 65 6e 64 7b 65 |'' butto|n.\end{e|
|000003f0| 6e 75 6d 65 72 61 74 65 | 7d 0a 4c 65 74 27 73 20 |numerate|}.Let's |
|00000400| 68 61 76 65 20 6c 6f 6f | 6b 20 6e 6f 77 20 74 6f |have loo|k now to|
|00000410| 20 20 74 68 65 20 6f 62 | 6a 65 63 74 73 20 77 65 | the ob|jects we|
|00000420| 27 6c 6c 20 68 61 76 65 | 20 74 6f 20 63 72 65 61 |'ll have| to crea|
|00000430| 74 65 20 66 6f 72 20 74 | 68 69 73 20 69 6e 74 65 |te for t|his inte|
|00000440| 72 66 61 63 65 2e 0a 46 | 69 72 73 74 20 77 65 20 |rface..F|irst we |
|00000450| 63 61 6e 20 63 72 65 61 | 74 65 20 74 68 65 20 74 |can crea|te the t|
|00000460| 6f 70 20 6c 61 62 65 6c | 20 61 6e 64 20 74 68 65 |op label| and the|
|00000470| 20 71 75 69 74 20 62 75 | 74 74 6f 6e 20 77 68 69 | quit bu|tton whi|
|00000480| 63 68 20 61 72 65 20 72 | 65 6c 61 74 69 76 65 6c |ch are r|elativel|
|00000490| 79 0a 73 69 6d 70 6c 65 | 2e 20 54 68 69 73 20 63 |y.simple|. This c|
|000004a0| 61 6e 20 62 65 20 64 6f | 6e 65 20 77 69 74 68 20 |an be do|ne with |
|000004b0| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 64 65 |the foll|owing de|
|000004c0| 66 69 6e 69 74 69 6f 6e | 73 3a 0a 5c 62 65 67 69 |finition|s:.\begi|
|000004d0| 6e 7b 71 75 6f 74 65 7d | 0a 5c 62 65 67 69 6e 7b |n{quote}|.\begin{|
|000004e0| 76 65 72 62 61 74 69 6d | 7d 0a 28 64 65 66 69 6e |verbatim|}.(defin|
|000004f0| 65 20 6c 61 62 20 20 28 | 6d 61 6b 65 20 3c 4c 61 |e lab (|make <La|
|00000500| 62 65 6c 3e 20 20 3a 74 | 65 78 74 20 22 41 20 73 |bel> :t|ext "A s|
|00000510| 69 6d 70 6c 65 20 69 6e | 74 65 72 66 61 63 65 22 |imple in|terface"|
|00000520| 29 29 0a 28 64 65 66 69 | 6e 65 20 71 75 69 74 20 |)).(defi|ne quit |
|00000530| 28 6d 61 6b 65 20 3c 42 | 75 74 74 6f 6e 3e 20 3a |(make <B|utton> :|
|00000540| 74 65 78 74 20 22 51 75 | 69 74 22 20 3a 63 6f 6d |text "Qu|it" :com|
|00000550| 6d 61 6e 64 20 27 28 65 | 78 69 74 29 29 29 0a 5c |mand '(e|xit))).\|
|00000560| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0a 5c 65 |end{verb|atim}.\e|
|00000570| 6e 64 7b 71 75 6f 74 65 | 7d 0a 54 68 65 20 7b 5c |nd{quote|}.The {\|
|00000580| 74 74 20 3a 63 6f 6d 6d | 61 6e 64 7d 20 69 6e 69 |tt :comm|and} ini|
|00000590| 74 2d 6b 65 79 77 6f 72 | 64 20 70 65 72 6d 69 74 |t-keywor|d permit|
|000005a0| 73 20 74 6f 20 61 73 73 | 6f 63 69 61 74 65 20 61 |s to ass|ociate a|
|000005b0| 6e 20 61 63 74 69 6f 6e | 20 74 6f 20 74 68 65 20 |n action| to the |
|000005c0| 62 75 74 74 6f 6e 0a 28 | 74 68 69 73 20 61 63 74 |button.(|this act|
|000005d0| 69 6f 6e 20 77 69 6c 6c | 20 62 65 20 74 72 69 67 |ion will| be trig|
|000005e0| 67 65 72 65 64 20 77 68 | 65 6e 20 74 68 65 20 6d |gered wh|en the m|
|000005f0| 6f 75 73 65 20 62 75 74 | 74 6f 6e 20 31 20 77 69 |ouse but|ton 1 wi|
|00000600| 6c 6c 20 62 65 20 72 65 | 6c 65 61 73 65 64 20 6f |ll be re|leased o|
|00000610| 76 65 72 0a 74 68 65 20 | 7b 5c 74 74 20 71 75 69 |ver.the |{\tt qui|
|00000620| 74 7d 20 62 75 74 74 6f | 6e 2e 0a 0a 54 68 65 20 |t} butto|n...The |
|00000630| 69 6e 74 65 72 66 61 63 | 65 20 73 68 6f 77 6e 20 |interfac|e shown |
|00000640| 69 6e 20 46 69 67 75 72 | 65 7e 5c 72 65 66 7b 66 |in Figur|e~\ref{f|
|00000650| 69 67 2d 73 69 6d 70 6c | 65 2d 69 6e 74 65 72 66 |ig-simpl|e-interf|
|00000660| 61 63 65 7d 20 63 61 6e | 20 62 65 20 73 65 65 6e |ace} can| be seen|
|00000670| 20 61 73 20 61 20 76 65 | 72 74 69 63 61 6c 20 61 | as a ve|rtical a|
|00000680| 6c 69 67 6e 6d 65 6e 74 | 20 6f 66 0a 20 74 68 72 |lignment| of. thr|
|00000690| 65 65 20 63 6f 6d 70 6f | 6e 65 6e 74 73 20 28 61 |ee compo|nents (a|
|000006a0| 20 6c 61 62 65 6c 2c 20 | 61 20 6c 69 73 74 62 6f | label, |a listbo|
|000006b0| 78 20 77 69 74 68 20 61 | 20 73 63 72 6f 6c 6c 62 |x with a| scrollb|
|000006c0| 61 72 20 61 6e 64 20 61 | 20 62 75 74 74 6f 6e 29 |ar and a| button)|
|000006d0| 2e 20 54 68 65 0a 73 65 | 63 6f 6e 64 20 63 6f 6d |. The.se|cond com|
|000006e0| 70 6f 6e 65 6e 74 20 69 | 73 20 69 74 73 65 6c 66 |ponent i|s itself|
|000006f0| 20 61 6e 20 61 6c 69 67 | 6e 6d 65 6e 74 20 6f 66 | an alig|nment of|
|00000700| 20 74 77 6f 20 6f 62 6a | 65 63 74 20 28 61 20 73 | two obj|ect (a s|
|00000710| 63 72 6f 6c 6c 62 61 72 | 20 61 6e 64 20 61 0a 6c |crollbar| and a.l|
|00000720| 69 73 74 62 6f 78 29 2e | 20 57 68 61 74 20 69 73 |istbox).| What is|
|00000730| 20 69 6d 70 6f 72 74 61 | 6e 74 20 74 6f 20 6e 6f | importa|nt to no|
|00000740| 74 65 20 68 65 72 65 20 | 69 73 20 74 68 61 74 20 |te here |is that |
|00000750| 74 68 69 73 20 61 6c 69 | 67 6e 6d 65 6e 74 20 69 |this ali|gnment i|
|00000760| 73 20 61 6e 0a 68 6f 72 | 69 7a 6f 6e 74 61 6c 20 |s an.hor|izontal |
|00000770| 6f 6e 65 20 73 69 74 75 | 61 74 65 64 20 69 6e 73 |one situ|ated ins|
|00000780| 69 64 65 20 61 20 76 65 | 72 74 69 63 61 6c 20 6f |ide a ve|rtical o|
|00000790| 6e 65 2e 20 49 6e 20 74 | 68 69 73 20 63 61 73 65 |ne. In t|his case|
|000007a0| 2c 20 77 65 20 68 61 76 | 65 20 74 6f 20 70 6c 61 |, we hav|e to pla|
|000007b0| 63 65 0a 74 68 65 20 63 | 6f 6d 70 6f 6e 65 6e 74 |ce.the c|omponent|
|000007c0| 73 20 6f 66 20 6f 75 72 | 20 68 6f 72 69 7a 6f 6e |s of our| horizon|
|000007d0| 74 61 6c 20 61 6c 69 67 | 6e 6d 65 6e 74 20 69 6e |tal alig|nment in|
|000007e0| 20 61 20 63 6f 6e 74 61 | 69 6e 65 72 20 77 68 69 | a conta|iner whi|
|000007f0| 63 68 20 61 63 74 73 20 | 61 73 20 61 20 6b 69 6e |ch acts |as a kin|
|00000800| 64 0a 6f 66 20 62 61 63 | 6b 20 62 6f 78 20 66 6f |d.of bac|k box fo|
|00000810| 72 20 66 75 72 74 68 65 | 72 20 6c 61 79 6f 75 74 |r furthe|r layout|
|00000820| 2e 20 54 68 65 20 77 69 | 64 67 65 74 20 77 68 69 |. The wi|dget whi|
|00000830| 63 68 20 70 65 72 6d 69 | 74 20 74 6f 20 60 60 65 |ch permi|t to ``e|
|00000840| 6d 62 6f 64 79 27 27 20 | 73 65 76 65 72 61 6c 0a |mbody'' |several.|
|00000850| 77 69 64 67 65 74 73 20 | 69 73 20 63 61 6c 6c 65 |widgets |is calle|
|00000860| 64 20 61 20 66 72 61 6d | 65 20 69 6e 20 74 68 65 |d a fram|e in the|
|00000870| 20 54 6b 20 74 6f 6f 6c | 6b 69 74 2e 20 43 6f 6e | Tk tool|kit. Con|
|00000880| 73 65 71 75 65 6e 74 6c | 79 2c 20 74 68 65 20 6c |sequentl|y, the l|
|00000890| 69 73 74 62 6f 78 20 61 | 6e 64 20 69 74 73 0a 73 |istbox a|nd its.s|
|000008a0| 63 72 6f 6c 6c 62 61 72 | 20 63 61 6e 20 62 65 20 |crollbar| can be |
|000008b0| 64 65 66 69 6e 65 64 20 | 62 79 3a 0a 5c 62 65 67 |defined |by:.\beg|
|000008c0| 69 6e 7b 71 75 6f 74 65 | 7d 0a 5c 62 65 67 69 6e |in{quote|}.\begin|
|000008d0| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 28 64 65 66 69 |{verbati|m}.(defi|
|000008e0| 6e 65 20 62 6f 78 20 20 | 28 6d 61 6b 65 20 3c 46 |ne box |(make <F|
|000008f0| 72 61 6d 65 3e 20 3a 62 | 6f 72 64 65 72 2d 77 69 |rame> :b|order-wi|
|00000900| 64 74 68 20 33 20 3a 72 | 65 6c 69 65 66 20 22 72 |dth 3 :r|elief "r|
|00000910| 69 64 67 65 22 29 29 0a | 28 64 65 66 69 6e 65 20 |idge")).|(define |
|00000920| 6c 20 20 20 20 28 6d 61 | 6b 65 20 3c 4c 69 73 74 |l (ma|ke <List|
|00000930| 62 6f 78 3e 20 20 20 3a | 70 61 72 65 6e 74 20 62 |box> :|parent b|
|00000940| 6f 78 29 29 0a 28 64 65 | 66 69 6e 65 20 73 20 20 |ox)).(de|fine s |
|00000950| 20 20 28 6d 61 6b 65 20 | 3c 53 63 72 6f 6c 6c 62 | (make |<Scrollb|
|00000960| 61 72 3e 20 3a 70 61 72 | 65 6e 74 20 62 6f 78 20 |ar> :par|ent box |
|00000970| 3a 6f 72 69 65 6e 74 61 | 74 69 6f 6e 20 22 76 65 |:orienta|tion "ve|
|00000980| 72 74 69 63 61 6c 22 29 | 29 0a 5c 65 6e 64 7b 76 |rtical")|).\end{v|
|00000990| 65 72 62 61 74 69 6d 7d | 0a 5c 65 6e 64 7b 71 75 |erbatim}|.\end{qu|
|000009a0| 6f 74 65 7d 0a 57 68 61 | 74 20 69 73 20 69 6d 70 |ote}.Wha|t is imp|
|000009b0| 6f 72 74 61 6e 74 20 74 | 6f 20 6e 6f 74 65 20 69 |ortant t|o note i|
|000009c0| 73 20 74 68 61 74 20 74 | 68 65 20 6c 69 73 74 62 |s that t|he listb|
|000009d0| 6f 78 20 61 6e 64 20 74 | 68 65 20 73 63 72 6f 6c |ox and t|he scrol|
|000009e0| 6c 62 61 72 20 62 6f 74 | 68 20 74 65 6c 6c 20 74 |lbar bot|h tell t|
|000009f0| 68 61 74 0a 74 68 65 69 | 72 20 7b 5c 65 6d 20 70 |hat.thei|r {\em p|
|00000a00| 61 72 65 6e 74 7d 20 69 | 73 20 74 68 65 20 66 72 |arent} i|s the fr|
|00000a10| 61 6d 65 20 7b 5c 74 74 | 20 62 6f 78 7d 2e 20 54 |ame {\tt| box}. T|
|00000a20| 68 69 73 20 69 73 20 74 | 68 69 73 20 69 6e 64 69 |his is t|his indi|
|00000a30| 63 61 74 69 6f 6e 20 77 | 68 69 63 68 0a 65 66 66 |cation w|hich.eff|
|00000a40| 65 63 74 69 76 65 6c 79 | 20 65 6d 62 6f 64 79 20 |ectively| embody |
|00000a50| 74 68 65 6d 20 69 6e 20 | 74 68 65 20 66 72 61 6d |them in |the fram|
|00000a60| 65 2e 0a 0a 0a 41 6c 6c | 20 74 68 65 20 62 61 73 |e....All| the bas|
|00000a70| 69 63 20 63 6f 6d 70 6f | 6e 65 6e 74 73 20 6f 66 |ic compo|nents of|
|00000a80| 20 6f 75 72 20 69 6e 74 | 65 72 66 61 63 65 20 68 | our int|erface h|
|00000a90| 61 76 65 20 62 65 65 6e | 20 63 72 65 61 74 65 64 |ave been| created|
|00000aa0| 2e 20 57 68 61 74 20 69 | 74 0a 72 65 73 74 73 20 |. What i|t.rests |
|00000ab0| 74 6f 20 64 6f 20 63 6f | 6e 73 69 73 74 73 20 74 |to do co|nsists t|
|00000ac0| 6f 20 70 6c 61 63 65 20 | 74 68 65 20 67 72 61 70 |o place |the grap|
|00000ad0| 68 69 63 20 63 6f 6d 70 | 6f 6e 65 6e 74 73 20 77 |hic comp|onents w|
|00000ae0| 65 20 68 61 76 65 20 6a | 75 73 74 20 64 65 66 69 |e have j|ust defi|
|00000af0| 6e 65 64 0a 6f 6e 74 6f | 20 73 63 72 65 65 6e 2e |ned.onto| screen.|
|00000b00| 20 46 69 72 73 74 20 77 | 65 20 63 61 6e 20 6d 61 | First w|e can ma|
|00000b10| 70 20 74 68 65 20 6c 69 | 73 74 62 6f 78 20 61 6e |p the li|stbox an|
|00000b20| 64 20 69 74 73 20 73 63 | 72 6f 6c 6c 62 61 72 20 |d its sc|rollbar |
|00000b30| 69 6e 20 74 68 65 20 7b | 5c 74 74 0a 62 6f 78 7d |in the {|\tt.box}|
|00000b40| 20 6f 62 6a 65 63 74 20 | 77 69 74 68 20 74 68 65 | object |with the|
|00000b50| 20 7b 5c 65 6d 20 70 61 | 63 6b 65 72 7d 5c 69 6e | {\em pa|cker}\in|
|00000b60| 64 65 78 7b 70 61 63 6b | 65 72 7d 20 67 65 6f 6d |dex{pack|er} geom|
|00000b70| 65 74 72 79 20 6d 61 6e | 61 67 65 72 20 28 73 65 |etry man|ager (se|
|00000b80| 65 0a 70 61 67 65 20 5c | 70 61 67 65 72 65 66 7b |e.page \|pageref{|
|00000b90| 70 61 63 6b 2d 64 6f 63 | 7d 29 3a 0a 5c 62 65 67 |pack-doc|}):.\beg|
|00000ba0| 69 6e 7b 71 75 6f 74 65 | 7d 0a 5c 62 65 67 69 6e |in{quote|}.\begin|
|00000bb0| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 28 70 61 63 6b |{verbati|m}.(pack|
|00000bc0| 20 6c 20 3a 65 78 70 61 | 6e 64 20 23 74 20 3a 66 | l :expa|nd #t :f|
|00000bd0| 69 6c 6c 20 22 62 6f 74 | 68 22 20 3a 73 69 64 65 |ill "bot|h" :side|
|00000be0| 20 22 6c 65 66 74 22 29 | 0a 28 70 61 63 6b 20 73 | "left")|.(pack s|
|00000bf0| 20 3a 65 78 70 61 6e 64 | 20 23 74 20 3a 66 69 6c | :expand| #t :fil|
|00000c00| 6c 20 22 79 22 20 3a 73 | 69 64 65 20 22 72 69 67 |l "y" :s|ide "rig|
|00000c10| 68 74 22 29 0a 5c 65 6e | 64 7b 76 65 72 62 61 74 |ht").\en|d{verbat|
|00000c20| 69 6d 7d 0a 5c 65 6e 64 | 7b 71 75 6f 74 65 7d 0a |im}.\end|{quote}.|
|00000c30| 42 6f 74 68 20 63 61 6c | 6c 73 20 74 6f 20 7b 5c |Both cal|ls to {\|
|00000c40| 74 74 20 70 61 63 6b 7d | 20 70 65 72 6d 69 74 20 |tt pack}| permit |
|00000c50| 74 6f 20 64 65 66 69 6e | 65 20 74 68 65 20 61 72 |to defin|e the ar|
|00000c60| 72 61 6e 67 65 6d 65 6e | 74 20 6f 66 20 74 68 65 |rangemen|t of the|
|00000c70| 20 6c 69 73 74 62 6f 78 | 0a 61 6e 64 20 74 68 65 | listbox|.and the|
|00000c80| 20 73 63 72 6f 6c 6c 62 | 61 72 20 69 6e 74 6f 20 | scrollb|ar into |
|00000c90| 74 68 65 20 66 72 61 6d | 65 2e 20 48 65 72 65 20 |the fram|e. Here |
|00000ca0| 77 65 20 63 6c 61 69 6d | 20 74 68 61 74 20 74 68 |we claim| that th|
|00000cb0| 65 20 73 63 72 6f 6c 6c | 62 61 72 20 73 68 6f 75 |e scroll|bar shou|
|00000cc0| 6c 64 0a 73 74 61 79 20 | 6f 6e 20 74 68 65 20 72 |ld.stay |on the r|
|00000cd0| 69 67 68 74 20 73 69 64 | 65 20 6f 66 20 74 68 65 |ight sid|e of the|
|00000ce0| 20 66 72 61 6d 65 20 61 | 6e 64 20 74 68 61 74 20 | frame a|nd that |
|00000cf0| 69 74 20 6d 75 73 74 20 | 65 78 70 61 6e 64 20 69 |it must |expand i|
|00000d00| 74 73 65 6c 66 20 6f 6e | 6c 79 20 69 6e 0a 74 68 |tself on|ly in.th|
|00000d10| 65 20 76 65 72 74 69 63 | 61 6c 20 64 69 72 65 63 |e vertic|al direc|
|00000d20| 74 69 6f 6e 20 69 66 20 | 69 74 73 20 63 6f 6e 74 |tion if |its cont|
|00000d30| 61 69 6e 69 6e 67 20 66 | 72 61 6d 65 20 28 69 2e |aining f|rame (i.|
|00000d40| 65 2e 20 7b 5c 74 74 20 | 62 6f 78 7d 29 20 69 73 |e. {\tt |box}) is|
|00000d50| 20 72 65 73 69 7a 65 64 | 2e 0a 43 6f 6e 63 65 72 | resized|..Concer|
|00000d60| 6e 69 6e 67 20 74 68 65 | 20 6c 69 73 74 62 6f 78 |ning the| listbox|
|00000d70| 2c 20 69 74 20 77 69 6c | 6c 20 73 74 61 79 20 6f |, it wil|l stay o|
|00000d80| 6e 20 72 69 67 74 68 20 | 61 6e 64 20 69 74 20 77 |n rigth |and it w|
|00000d90| 69 6c 6c 20 66 69 6c 6c | 20 61 6c 6c 20 74 68 65 |ill fill| all the|
|00000da0| 0a 73 70 61 63 65 20 28 | 7b 5c 74 74 20 3a 66 69 |.space (|{\tt :fi|
|00000db0| 6c 6c 7e 22 62 6f 74 68 | 22 7d 29 20 69 66 20 7b |ll~"both|"}) if {|
|00000dc0| 5c 74 74 20 62 6f 78 7d | 20 73 69 7a 65 20 63 68 |\tt box}| size ch|
|00000dd0| 61 6e 67 65 73 2e 0a 0a | 4e 6f 77 20 77 65 20 63 |anges...|Now we c|
|00000de0| 61 6e 20 7b 5c 65 6d 20 | 70 61 63 6b 7d 20 74 68 |an {\em |pack} th|
|00000df0| 65 20 74 68 72 65 65 20 | 63 6f 6d 70 6f 6e 65 6e |e three |componen|
|00000e00| 74 73 20 6f 66 20 74 68 | 69 73 20 73 69 6d 70 6c |ts of th|is simpl|
|00000e10| 65 20 69 6e 74 65 72 66 | 61 63 65 20 74 6f 20 73 |e interf|ace to s|
|00000e20| 68 6f 77 0a 75 70 20 74 | 68 65 6d 20 6f 6e 20 73 |how.up t|hem on s|
|00000e30| 63 72 65 65 6e 3b 20 69 | 74 20 63 61 6e 20 62 65 |creen; i|t can be|
|00000e40| 20 65 61 73 69 6c 79 20 | 64 6f 6e 65 20 62 79 3a | easily |done by:|
|00000e50| 0a 5c 62 65 67 69 6e 7b | 71 75 6f 74 65 7d 0a 5c |.\begin{|quote}.\|
|00000e60| 62 65 67 69 6e 7b 76 65 | 72 62 61 74 69 6d 7d 0a |begin{ve|rbatim}.|
|00000e70| 28 70 61 63 6b 20 6c 61 | 62 20 62 6f 78 20 71 75 |(pack la|b box qu|
|00000e80| 69 74 29 0a 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |it).\end|{verbati|
|00000e90| 6d 7d 0a 5c 65 6e 64 7b | 71 75 6f 74 65 7d 0a 54 |m}.\end{|quote}.T|
|00000ea0| 68 65 20 63 6f 6d 70 6c | 65 74 65 20 70 72 6f 67 |he compl|ete prog|
|00000eb0| 72 61 6d 20 66 6f 72 20 | 74 68 65 20 62 75 69 6c |ram for |the buil|
|00000ec0| 64 69 6e 67 20 74 68 65 | 20 70 72 65 76 69 6f 75 |ding the| previou|
|00000ed0| 73 20 69 6e 74 65 72 66 | 61 63 65 20 69 73 20 67 |s interf|ace is g|
|00000ee0| 69 76 65 6e 20 69 6e 0a | 46 69 67 75 72 65 7e 5c |iven in.|Figure~\|
|00000ef0| 72 65 66 7b 73 69 6d 70 | 6c 65 3a 74 68 65 5f 63 |ref{simp|le:the_c|
|00000f00| 6f 64 65 7d 2e 0a 0a 5c | 62 65 67 69 6e 7b 66 69 |ode}...\|begin{fi|
|00000f10| 67 75 72 65 7d 0a 7b 5c | 66 6f 6f 74 6e 6f 74 65 |gure}.{\|footnote|
|00000f20| 73 69 7a 65 0a 5c 62 65 | 67 69 6e 7b 76 65 72 62 |size.\be|gin{verb|
|00000f30| 61 74 69 6d 7d 0a 3b 3b | 3b 20 44 65 66 69 6e 69 |atim}.;;|; Defini|
|00000f40| 6e 67 20 74 68 65 20 63 | 6f 6d 70 6f 6e 65 6e 74 |ng the c|omponent|
|00000f50| 73 0a 28 64 65 66 69 6e | 65 20 6c 61 62 20 20 28 |s.(defin|e lab (|
|00000f60| 6d 61 6b 65 20 3c 4c 61 | 62 65 6c 3e 20 20 3a 74 |make <La|bel> :t|
|00000f70| 65 78 74 20 22 41 20 73 | 69 6d 70 6c 65 20 69 6e |ext "A s|imple in|
|00000f80| 74 65 72 66 61 63 65 22 | 29 29 0a 28 64 65 66 69 |terface"|)).(defi|
|00000f90| 6e 65 20 71 75 69 74 20 | 28 6d 61 6b 65 20 3c 42 |ne quit |(make <B|
|00000fa0| 75 74 74 6f 6e 3e 20 3a | 74 65 78 74 20 22 51 75 |utton> :|text "Qu|
|00000fb0| 69 74 22 20 3a 63 6f 6d | 6d 61 6e 64 20 27 28 65 |it" :com|mand '(e|
|00000fc0| 78 69 74 29 29 29 0a 28 | 64 65 66 69 6e 65 20 62 |xit))).(|define b|
|00000fd0| 6f 78 20 20 28 6d 61 6b | 65 20 3c 46 72 61 6d 65 |ox (mak|e <Frame|
|00000fe0| 3e 20 20 3a 62 6f 72 64 | 65 72 2d 77 69 64 74 68 |> :bord|er-width|
|00000ff0| 20 33 20 3a 72 65 6c 69 | 65 66 20 22 72 69 64 67 | 3 :reli|ef "ridg|
|00001000| 65 22 29 29 0a 0a 3b 3b | 3b 20 5a 6f 6f 6d 20 69 |e"))..;;|; Zoom i|
|00001010| 6e 20 74 68 65 20 62 6f | 78 0a 28 64 65 66 69 6e |n the bo|x.(defin|
|00001020| 65 20 6c 20 20 20 20 28 | 6d 61 6b 65 20 3c 4c 69 |e l (|make <Li|
|00001030| 73 74 62 6f 78 3e 20 20 | 20 3a 70 61 72 65 6e 74 |stbox> | :parent|
|00001040| 20 62 6f 78 29 29 0a 28 | 64 65 66 69 6e 65 20 73 | box)).(|define s|
|00001050| 20 20 20 20 28 6d 61 6b | 65 20 3c 53 63 72 6f 6c | (mak|e <Scrol|
|00001060| 6c 62 61 72 3e 20 3a 70 | 61 72 65 6e 74 20 62 6f |lbar> :p|arent bo|
|00001070| 78 20 3a 6f 72 69 65 6e | 74 61 74 69 6f 6e 20 22 |x :orien|tation "|
|00001080| 76 65 72 74 69 63 61 6c | 22 29 29 0a 0a 28 70 61 |vertical|"))..(pa|
|00001090| 63 6b 20 6c 20 3a 65 78 | 70 61 6e 64 20 23 74 20 |ck l :ex|pand #t |
|000010a0| 3a 66 69 6c 6c 20 22 62 | 6f 74 68 22 20 3a 73 69 |:fill "b|oth" :si|
|000010b0| 64 65 20 22 6c 65 66 74 | 22 29 0a 28 70 61 63 6b |de "left|").(pack|
|000010c0| 20 73 20 3a 65 78 70 61 | 6e 64 20 23 74 20 3a 66 | s :expa|nd #t :f|
|000010d0| 69 6c 6c 20 22 79 22 20 | 3a 73 69 64 65 20 22 72 |ill "y" |:side "r|
|000010e0| 69 67 68 74 22 29 0a 0a | 3b 3b 3b 20 50 61 63 6b |ight")..|;;; Pack|
|000010f0| 20 74 68 65 20 63 6f 6d | 70 6f 6e 65 6e 74 73 0a | the com|ponents.|
|00001100| 28 70 61 63 6b 20 6c 61 | 62 20 62 6f 78 20 71 75 |(pack la|b box qu|
|00001110| 69 74 29 0a 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |it).\end|{verbati|
|00001120| 6d 7d 0a 7d 0a 5c 63 61 | 70 74 69 6f 6e 7b 43 6f |m}.}.\ca|ption{Co|
|00001130| 6d 70 6c 65 74 65 20 63 | 6f 64 65 20 66 6f 72 20 |mplete c|ode for |
|00001140| 74 68 65 20 73 69 6d 70 | 6c 65 20 69 6e 74 65 72 |the simp|le inter|
|00001150| 66 61 63 65 7d 0a 5c 6c | 61 62 65 6c 7b 73 69 6d |face}.\l|abel{sim|
|00001160| 70 6c 65 3a 74 68 65 5f | 63 6f 64 65 7d 0a 5c 65 |ple:the_|code}.\e|
|00001170| 6e 64 7b 66 69 67 75 72 | 65 7d 0a 0a 5c 73 75 62 |nd{figur|e}..\sub|
|00001180| 73 75 62 73 65 63 74 69 | 6f 6e 7b 46 69 6c 6c 69 |subsecti|on{Filli|
|00001190| 6e 67 20 74 68 65 20 6c | 69 73 74 62 6f 78 7d 0a |ng the l|istbox}.|
|000011a0| 0a 46 69 6c 6c 69 6e 67 | 20 74 68 65 20 6c 69 73 |.Filling| the lis|
|000011b0| 74 62 6f 78 20 63 61 6e | 20 62 65 20 64 6f 6e 65 |tbox can| be done|
|000011c0| 20 62 79 20 63 61 6c 6c | 69 6e 67 20 74 68 65 20 | by call|ing the |
|000011d0| 7b 5c 74 74 20 69 6e 73 | 65 72 74 7d 0a 5c 69 6e |{\tt ins|ert}.\in|
|000011e0| 64 65 78 7b 6c 69 73 74 | 62 6f 78 20 69 6e 73 65 |dex{list|box inse|
|000011f0| 72 74 7d 20 6d 65 74 68 | 6f 64 2e 20 54 68 69 73 |rt} meth|od. This|
|00001200| 20 6d 65 74 68 6f 64 20 | 70 65 72 6d 69 74 73 20 | method |permits |
|00001210| 74 6f 20 61 64 64 20 65 | 6c 65 6d 65 6e 74 73 20 |to add e|lements |
|00001220| 69 6e 20 74 68 65 0a 6c | 69 73 74 62 6f 78 2e 20 |in the.l|istbox. |
|00001230| 41 20 77 61 79 20 74 6f | 20 66 69 6c 6c 20 74 68 |A way to| fill th|
|00001240| 65 20 70 72 65 76 69 6f | 75 73 20 6c 69 73 62 6f |e previo|us lisbo|
|00001250| 78 20 63 6f 75 6c 64 20 | 62 65 3a 0a 5c 62 65 67 |x could |be:.\beg|
|00001260| 69 6e 7b 71 75 6f 74 65 | 7d 0a 5c 62 65 67 69 6e |in{quote|}.\begin|
|00001270| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 28 69 6e 73 65 |{verbati|m}.(inse|
|00001280| 72 74 20 6c 20 30 20 22 | 61 22 20 22 62 22 20 22 |rt l 0 "|a" "b" "|
|00001290| 63 22 29 0a 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |c").\end|{verbati|
|000012a0| 6d 7d 0a 5c 65 6e 64 7b | 71 75 6f 74 65 7d 0a 54 |m}.\end{|quote}.T|
|000012b0| 68 69 73 20 77 69 6c 6c | 20 69 6e 73 65 72 74 20 |his will| insert |
|000012c0| 33 20 6c 69 6e 65 73 20 | 28 63 6f 6e 74 61 69 6e |3 lines |(contain|
|000012d0| 69 6e 67 20 7b 5c 74 74 | 20 22 61 22 7d 2c 20 7b |ing {\tt| "a"}, {|
|000012e0| 5c 74 74 20 22 62 22 7d | 20 61 6e 64 20 7b 5c 74 |\tt "b"}| and {\t|
|000012f0| 74 20 22 63 22 7d 29 0a | 61 66 74 65 72 20 74 68 |t "c"}).|after th|
|00001300| 65 20 65 6c 65 6d 65 6e | 74 20 77 68 6f 73 65 20 |e elemen|t whose |
|00001310| 69 6e 64 65 78 20 69 73 | 20 30 2e 20 49 6e 73 65 |index is| 0. Inse|
|00001320| 72 74 69 6e 67 20 61 20 | 7b 5c 74 74 20 22 64 22 |rting a |{\tt "d"|
|00001330| 7d 20 62 65 74 77 65 65 | 6e 20 7b 5c 74 74 20 22 |} betwee|n {\tt "|
|00001340| 61 22 7d 0a 61 6e 64 20 | 7b 5c 74 74 20 22 62 22 |a"}.and |{\tt "b"|
|00001350| 7d 20 63 6f 75 6c 64 20 | 62 65 20 64 6f 6e 65 20 |} could |be done |
|00001360| 62 79 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |by the f|ollowing|
|00001370| 20 65 78 70 72 65 73 73 | 69 6f 6e 3a 0a 5c 62 65 | express|ion:.\be|
|00001380| 67 69 6e 7b 71 75 6f 74 | 65 7d 0a 5c 62 65 67 69 |gin{quot|e}.\begi|
|00001390| 6e 7b 76 65 72 62 61 74 | 69 6d 7d 0a 28 69 6e 73 |n{verbat|im}.(ins|
|000013a0| 65 72 74 20 6c 20 31 20 | 22 64 22 29 0a 5c 65 6e |ert l 1 |"d").\en|
|000013b0| 64 7b 76 65 72 62 61 74 | 69 6d 7d 0a 5c 65 6e 64 |d{verbat|im}.\end|
|000013c0| 7b 71 75 6f 74 65 7d 0a | 0a 44 65 6c 65 74 69 6e |{quote}.|.Deletin|
|000013d0| 67 20 65 6c 65 6d 65 6e | 74 73 20 6f 66 20 6c 69 |g elemen|ts of li|
|000013e0| 73 74 62 6f 78 20 6e 65 | 63 65 73 73 69 74 61 74 |stbox ne|cessitat|
|000013f0| 65 73 20 61 20 63 61 6c | 6c 20 74 6f 20 74 68 65 |es a cal|l to the|
|00001400| 20 7b 5c 74 74 20 64 65 | 6c 65 74 65 7d 0a 6d 65 | {\tt de|lete}.me|
|00001410| 74 68 6f 64 2e 20 46 6f | 72 20 69 6e 73 74 61 6e |thod. Fo|r instan|
|00001420| 63 65 2c 0a 5c 62 65 67 | 69 6e 7b 71 75 6f 74 65 |ce,.\beg|in{quote|
|00001430| 7d 0a 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |}.\begin|{verbati|
|00001440| 6d 7d 0a 28 64 65 6c 65 | 74 65 20 6c 20 31 29 0a |m}.(dele|te l 1).|
|00001450| 5c 65 6e 64 7b 76 65 72 | 62 61 74 69 6d 7d 0a 5c |\end{ver|batim}.\|
|00001460| 65 6e 64 7b 71 75 6f 74 | 65 7d 0a 64 65 6c 65 74 |end{quot|e}.delet|
|00001470| 65 73 20 74 68 65 20 73 | 65 63 6f 6e 64 20 65 6c |es the s|econd el|
|00001480| 65 6d 65 6e 74 20 6f 66 | 20 74 68 65 20 6c 69 73 |ement of| the lis|
|00001490| 74 62 6f 78 20 28 66 69 | 72 73 74 20 65 6c 65 6d |tbox (fi|rst elem|
|000014a0| 65 6e 74 20 69 73 20 61 | 74 20 69 6e 64 65 78 20 |ent is a|t index |
|000014b0| 30 29 2c 20 61 6e 64 0a | 5c 62 65 67 69 6e 7b 71 |0), and.|\begin{q|
|000014c0| 75 6f 74 65 7d 0a 5c 62 | 65 67 69 6e 7b 76 65 72 |uote}.\b|egin{ver|
|000014d0| 62 61 74 69 6d 7d 0a 28 | 64 65 6c 65 74 65 20 6c |batim}.(|delete l|
|000014e0| 20 30 20 32 29 0a 5c 65 | 6e 64 7b 76 65 72 62 61 | 0 2).\e|nd{verba|
|000014f0| 74 69 6d 7d 0a 5c 65 6e | 64 7b 71 75 6f 74 65 7d |tim}.\en|d{quote}|
|00001500| 0a 70 65 72 6d 69 74 73 | 20 74 6f 20 64 65 6c 65 |.permits| to dele|
|00001510| 74 65 20 74 68 65 20 74 | 68 72 65 65 20 72 65 6d |te the t|hree rem|
|00001520| 61 69 6e 69 6e 67 20 65 | 6c 65 6d 65 6e 74 73 2e |aining e|lements.|
|00001530| 20 0a 0a 7b 5c 74 74 20 | 49 6e 73 65 72 74 7d 20 | ..{\tt |Insert} |
|00001540| 61 6e 64 20 7b 5c 74 74 | 20 64 65 6c 65 74 65 7d |and {\tt| delete}|
|00001550| 20 61 72 65 20 73 69 6d | 70 6c 65 20 6d 65 74 68 | are sim|ple meth|
|00001560| 6f 64 73 20 62 75 69 6c | 74 20 75 70 6f 6e 20 54 |ods buil|t upon T|
|00001570| 6b 20 63 6f 6d 6d 61 6e | 64 73 20 74 6f 0a 61 63 |k comman|ds to.ac|
|00001580| 63 65 73 73 73 20 6c 69 | 73 74 62 6f 78 2e 20 4d |cesss li|stbox. M|
|00001590| 6f 73 74 20 6f 66 20 74 | 68 65 20 74 69 6d 65 2c |ost of t|he time,|
|000015a0| 20 74 68 69 73 20 77 61 | 79 20 6f 66 20 61 63 63 | this wa|y of acc|
|000015b0| 65 73 73 69 6e 67 20 61 | 20 6c 69 73 74 62 6f 78 |essing a| listbox|
|000015c0| 20 69 73 20 6e 6f 74 0a | 74 6f 6f 20 63 6f 6e 76 | is not.|too conv|
|000015d0| 65 6e 69 65 6e 74 2c 20 | 61 6e 64 20 69 74 20 69 |enient, |and it i|
|000015e0| 73 20 6d 6f 72 65 20 65 | 61 73 79 20 74 6f 20 73 |s more e|asy to s|
|000015f0| 65 65 20 74 68 65 20 63 | 6f 6e 74 65 6e 74 20 6f |ee the c|ontent o|
|00001600| 66 20 61 20 6c 69 73 74 | 62 6f 78 20 61 73 20 69 |f a list|box as i|
|00001610| 74 73 0a 76 61 6c 75 65 | 2e 20 43 6f 6e 73 65 71 |ts.value|. Conseq|
|00001620| 75 65 6e 74 6c 79 2c 20 | 74 68 65 20 7b 5c 74 74 |uently, |the {\tt|
|00001630| 20 73 74 6b 6c 6f 73 7d | 20 7b 5c 74 74 20 3c 4c | stklos}| {\tt <L|
|00001640| 69 73 74 62 6f 78 3e 7d | 20 63 6c 61 73 73 20 64 |istbox>}| class d|
|00001650| 65 66 69 6e 65 73 20 61 | 0a 76 69 72 74 75 61 6c |efines a|.virtual|
|00001660| 20 73 6c 6f 74 5c 63 69 | 74 65 7b 76 69 72 74 75 | slot\ci|te{virtu|
|00001670| 61 6c 20 73 6c 6f 74 7d | 20 63 61 6c 6c 65 64 20 |al slot}| called |
|00001680| 7b 5c 74 74 20 76 61 6c | 75 65 7d 5c 69 6e 64 65 |{\tt val|ue}\inde|
|00001690| 78 7b 76 61 6c 75 65 7d | 20 77 68 69 63 68 0a 70 |x{value}| which.p|
|000016a0| 65 72 6d 69 74 73 20 74 | 6f 20 72 65 61 64 2f 66 |ermits t|o read/f|
|000016b0| 69 6c 6c 20 74 68 65 20 | 63 6f 6e 74 65 6e 74 73 |ill the |contents|
|000016c0| 20 6f 66 20 61 20 6c 69 | 73 74 62 6f 78 20 61 73 | of a li|stbox as|
|000016d0| 20 61 20 7b 5c 73 74 6b | 6c 6f 73 7d 20 73 6c 6f | a {\stk|los} slo|
|000016e0| 74 2e 0a 46 6f 72 20 69 | 6e 73 74 61 6e 63 65 2c |t..For i|nstance,|
|000016f0| 20 74 68 65 20 70 72 65 | 76 69 6f 75 73 20 6c 69 | the pre|vious li|
|00001700| 73 74 62 6f 78 20 63 61 | 6e 20 62 65 20 66 69 6c |stbox ca|n be fil|
|00001710| 6c 65 64 20 77 69 74 68 | 3a 0a 5c 62 65 67 69 6e |led with|:.\begin|
|00001720| 7b 71 75 6f 74 65 7d 0a | 5c 62 65 67 69 6e 7b 76 |{quote}.|\begin{v|
|00001730| 65 72 62 61 74 69 6d 7d | 0a 28 73 65 74 21 20 28 |erbatim}|.(set! (|
|00001740| 76 61 6c 75 65 20 6c 29 | 20 27 28 22 61 22 20 22 |value l)| '("a" "|
|00001750| 62 22 20 22 63 22 29 29 | 20 20 3b 3b 20 6f 72 20 |b" "c"))| ;; or |
|00001760| 28 73 6c 6f 74 2d 73 65 | 74 21 20 6c 20 27 76 61 |(slot-se|t! l 'va|
|00001770| 6c 75 65 20 27 28 2e 2e | 2e 29 29 0a 5c 65 6e 64 |lue '(..|.)).\end|
|00001780| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 5c 65 6e 64 7b |{verbati|m}.\end{|
|00001790| 71 75 6f 74 65 7d 0a 61 | 6e 64 20 74 68 65 20 76 |quote}.a|nd the v|
|000017a0| 61 6c 75 65 20 6f 66 20 | 74 68 65 20 73 65 63 6f |alue of |the seco|
|000017b0| 6e 64 20 65 6c 65 6d 65 | 6e 74 20 6f 66 20 74 68 |nd eleme|nt of th|
|000017c0| 65 20 6c 69 73 74 62 6f | 78 20 63 61 6e 20 62 65 |e listbo|x can be|
|000017d0| 20 6f 62 74 61 69 6e 65 | 64 20 62 79 0a 5c 62 65 | obtaine|d by.\be|
|000017e0| 67 69 6e 7b 71 75 6f 74 | 65 7d 0a 5c 62 65 67 69 |gin{quot|e}.\begi|
|000017f0| 6e 7b 76 65 72 62 61 74 | 69 6d 7d 0a 28 6c 69 73 |n{verbat|im}.(lis|
|00001800| 74 2d 72 65 66 20 28 76 | 61 6c 75 65 20 6c 29 20 |t-ref (v|alue l) |
|00001810| 31 29 0a 5c 65 6e 64 7b | 76 65 72 62 61 74 69 6d |1).\end{|verbatim|
|00001820| 7d 0a 5c 65 6e 64 7b 71 | 75 6f 74 65 7d 0a 0a 4f |}.\end{q|uote}..O|
|00001830| 66 20 63 6f 75 72 73 65 | 2c 20 74 68 65 20 76 61 |f course|, the va|
|00001840| 6c 75 65 20 73 6c 6f 74 | 20 68 61 73 20 61 6e 20 |lue slot| has an |
|00001850| 69 6e 69 74 69 61 6c 69 | 7a 61 74 69 6f 6e 20 6b |initiali|zation k|
|00001860| 65 77 6f 72 64 20 61 73 | 73 6f 63 69 61 74 65 64 |eword as|sociated|
|00001870| 20 74 6f 20 69 74 2c 0a | 61 6e 64 20 74 68 65 20 | to it,.|and the |
|00001880| 66 69 6c 6c 69 6e 67 20 | 6f 66 20 74 68 65 20 6c |filling |of the l|
|00001890| 69 73 74 62 6f 78 20 63 | 6f 75 6c 64 20 68 61 76 |istbox c|ould hav|
|000018a0| 65 20 62 65 65 6e 20 64 | 6f 6e 65 20 64 75 72 69 |e been d|one duri|
|000018b0| 6e 67 20 74 68 65 20 64 | 65 66 69 6e 69 74 69 6f |ng the d|efinitio|
|000018c0| 6e 0a 6f 66 20 74 68 65 | 20 6c 69 73 74 62 6f 78 |n.of the| listbox|
|000018d0| 3a 0a 5c 62 65 67 69 6e | 7b 71 75 6f 74 65 7d 0a |:.\begin|{quote}.|
|000018e0| 5c 62 65 67 69 6e 7b 76 | 65 72 62 61 74 69 6d 7d |\begin{v|erbatim}|
|000018f0| 0a 28 64 65 66 69 6e 65 | 20 6c 20 28 6d 61 6b 65 |.(define| l (make|
|00001900| 20 3c 4c 69 73 74 62 6f | 78 3e 20 3a 70 61 72 65 | <Listbo|x> :pare|
|00001910| 6e 74 20 62 6f 78 20 0a | 20 20 20 20 20 20 20 20 |nt box .| |
|00001920| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001930| 20 20 3a 76 61 6c 75 65 | 20 20 27 28 22 61 22 20 | :value| '("a" |
|00001940| 22 62 22 20 22 63 22 29 | 29 29 0a 5c 65 6e 64 7b |"b" "c")|)).\end{|
|00001950| 76 65 72 62 61 74 69 6d | 7d 0a 5c 65 6e 64 7b 71 |verbatim|}.\end{q|
|00001960| 75 6f 74 65 7d 0a 0a 5c | 73 75 62 73 75 62 73 65 |uote}..\|subsubse|
|00001970| 63 74 69 6f 6e 7b 42 72 | 69 6e 67 69 6e 67 20 74 |ction{Br|inging t|
|00001980| 68 65 20 73 63 72 6f 6c | 6c 62 61 72 20 74 6f 20 |he scrol|lbar to |
|00001990| 6c 69 66 65 7d 0a 0a 46 | 6f 72 20 6e 6f 77 2c 20 |life}..F|or now, |
|000019a0| 74 68 65 20 6c 69 73 62 | 6f 78 20 61 6e 64 20 74 |the lisb|ox and t|
|000019b0| 68 65 20 73 63 72 6f 6c | 6c 62 61 72 20 61 72 65 |he scrol|lbar are|
|000019c0| 20 64 69 73 63 6f 6e 6e | 65 63 74 65 64 20 28 69 | disconn|ected (i|
|000019d0| 2e 65 2e 20 6d 6f 76 69 | 6e 67 20 74 68 65 0a 6c |.e. movi|ng the.l|
|000019e0| 69 73 74 62 6f 78 2c 20 | 77 69 74 68 20 7b 5c 74 |istbox, |with {\t|
|000019f0| 74 20 3c 53 68 69 66 74 | 2d 42 75 74 74 6f 6e 32 |t <Shift|-Button2|
|00001a00| 3e 7d 20 64 6f 65 73 6e | 27 74 20 6d 6f 76 65 20 |>} doesn|'t move |
|00001a10| 74 68 65 20 73 63 72 6f | 6c 6c 62 61 72 20 61 6e |the scro|llbar an|
|00001a20| 64 20 63 6c 69 63 6b 69 | 6e 67 0a 74 68 65 20 73 |d clicki|ng.the s|
|00001a30| 63 72 6f 6c 6c 62 61 72 | 20 64 6f 65 73 20 6e 6f |crollbar| does no|
|00001a40| 74 68 69 6e 67 29 2e 20 | 54 6f 20 6d 61 6b 65 20 |thing). |To make |
|00001a50| 62 6f 74 68 20 77 69 64 | 67 65 74 73 20 77 6f 72 |both wid|gets wor|
|00001a60| 6b 69 6e 67 20 61 63 63 | 6f 72 64 69 6e 67 6c 79 |king acc|ordingly|
|00001a70| 2c 20 77 65 20 68 61 76 | 65 0a 74 6f 20 61 73 73 |, we hav|e.to ass|
|00001a80| 6f 63 69 61 74 65 20 61 | 20 63 6f 6d 6d 61 6e 64 |ociate a| command|
|00001a90| 20 74 6f 20 65 61 63 68 | 20 77 69 64 67 65 74 2e | to each| widget.|
|00001aa0| 20 46 69 72 73 74 2c 20 | 77 65 20 63 61 6e 20 61 | First, |we can a|
|00001ab0| 73 73 6f 63 69 61 74 65 | 20 61 20 63 6f 6d 6d 61 |ssociate| a comma|
|00001ac0| 6e 64 20 74 6f 0a 74 68 | 65 20 73 63 72 6f 6c 6c |nd to.th|e scroll|
|00001ad0| 62 61 72 2c 20 73 75 63 | 68 20 61 73 20 6d 6f 76 |bar, suc|h as mov|
|00001ae0| 69 6e 67 20 69 74 20 77 | 69 74 68 20 6d 6f 75 73 |ing it w|ith mous|
|00001af0| 65 20 62 75 74 74 6f 6e | 20 77 69 6c 6c 20 6d 6f |e button| will mo|
|00001b00| 76 65 20 74 68 65 20 6c | 69 73 74 62 6f 78 2e 20 |ve the l|istbox. |
|00001b10| 54 68 69 73 0a 63 61 6e | 20 62 65 20 64 6f 6e 65 |This.can| be done|
|00001b20| 20 77 69 74 68 3a 0a 5c | 62 65 67 69 6e 7b 71 75 | with:.\|begin{qu|
|00001b30| 6f 74 65 7d 0a 5c 62 65 | 67 69 6e 7b 76 65 72 62 |ote}.\be|gin{verb|
|00001b40| 61 74 69 6d 7d 0a 28 73 | 65 74 21 20 28 63 6f 6d |atim}.(s|et! (com|
|00001b50| 6d 61 6e 64 20 73 29 20 | 28 66 6f 72 6d 61 74 20 |mand s) |(format |
|00001b60| 23 66 20 22 79 2d 76 69 | 65 77 20 7e 53 20 22 20 |#f "y-vi|ew ~S " |
|00001b70| 28 61 64 64 72 65 73 73 | 2d 6f 66 20 6c 29 29 29 |(address|-of l)))|
|00001b80| 0a 5c 65 6e 64 7b 76 65 | 72 62 61 74 69 6d 7d 0a |.\end{ve|rbatim}.|
|00001b90| 5c 65 6e 64 7b 71 75 6f | 74 65 7d 0a 77 68 69 63 |\end{quo|te}.whic|
|00001ba0| 68 20 61 73 73 6f 63 69 | 61 74 65 73 20 74 68 65 |h associ|ates the|
|00001bb0| 20 70 72 65 66 69 78 20 | 6f 66 20 61 20 53 63 68 | prefix |of a Sch|
|00001bc0| 65 6d 65 20 63 6f 6d 6d | 61 6e 64 20 74 6f 20 69 |eme comm|and to i|
|00001bd0| 6e 76 6f 6b 65 20 74 6f | 20 63 68 61 6e 67 65 20 |nvoke to| change |
|00001be0| 74 68 65 20 76 69 65 77 | 0a 69 6e 20 74 68 65 20 |the view|.in the |
|00001bf0| 6c 69 73 74 62 6f 78 20 | 77 68 65 6e 20 74 68 65 |listbox |when the|
|00001c00| 20 75 73 65 72 20 6d 61 | 6e 69 70 75 6c 61 74 65 | user ma|nipulate|
|00001c10| 73 20 74 68 65 20 73 63 | 72 6f 6c 6c 62 61 72 2e |s the sc|rollbar.|
|00001c20| 20 54 68 69 73 20 63 6f | 6d 6d 61 6e 64 20 69 73 | This co|mmand is|
|00001c30| 0a 70 61 72 74 69 61 6c | 20 61 6e 64 20 77 69 6c |.partial| and wil|
|00001c40| 6c 20 62 65 20 63 6f 6d | 70 6c 65 74 65 64 20 65 |l be com|pleted e|
|00001c50| 66 66 65 63 74 69 76 65 | 6c 79 20 77 68 65 6e 20 |ffective|ly when |
|00001c60| 74 68 65 20 75 73 65 72 | 20 77 69 6c 6c 20 63 6c |the user| will cl|
|00001c70| 69 63 6b 20 74 68 65 0a | 73 63 72 6f 6c 6c 62 61 |ick the.|scrollba|
|00001c80| 72 20 28 73 65 65 20 74 | 68 65 20 3c 53 63 72 6f |r (see t|he <Scro|
|00001c90| 6c 6c 62 61 72 3e 20 63 | 6c 61 73 73 20 64 65 73 |llbar> c|lass des|
|00001ca0| 63 72 69 70 74 69 6f 6e | 20 6f 6e 0a 70 61 67 65 |cription| on.page|
|00001cb0| 7e 5c 70 61 67 65 72 65 | 66 7b 53 63 72 6f 6c 6c |~\pagere|f{Scroll|
|00001cc0| 62 61 72 2d 63 6c 61 73 | 73 7d 20 66 6f 72 20 6d |bar-clas|s} for m|
|00001cd0| 6f 72 65 20 64 65 74 61 | 69 6c 73 29 2e 0a 0a 54 |ore deta|ils)...T|
|00001ce0| 68 69 73 20 69 73 20 61 | 74 20 20 68 61 6c 66 20 |his is a|t half |
|00001cf0| 77 61 79 20 6f 66 20 77 | 68 61 74 20 77 65 20 68 |way of w|hat we h|
|00001d00| 61 76 65 20 74 6f 20 64 | 6f 20 66 6f 72 20 63 6c |ave to d|o for cl|
|00001d10| 65 61 6e 6c 79 20 61 73 | 73 6f 63 69 61 74 65 20 |eanly as|sociate |
|00001d20| 74 68 65 20 73 63 72 6f | 6c 6c 62 61 72 0a 61 6e |the scro|llbar.an|
|00001d30| 64 20 74 68 65 20 6c 69 | 73 74 62 6f 78 2e 20 4f |d the li|stbox. O|
|00001d40| 6e 20 74 68 65 20 6c 69 | 73 74 62 6f 78 20 73 69 |n the li|stbox si|
|00001d50| 64 65 2c 20 77 65 20 68 | 61 76 65 20 74 6f 20 61 |de, we h|ave to a|
|00001d60| 73 73 6f 63 69 61 74 65 | 20 61 20 63 6f 6d 6d 61 |ssociate| a comma|
|00001d70| 6e 64 20 66 6f 72 20 69 | 74 73 20 0a 76 65 72 74 |nd for i|ts .vert|
|00001d80| 69 63 61 6c 20 6d 6f 76 | 65 6d 65 6e 74 3a 0a 5c |ical mov|ement:.\|
|00001d90| 62 65 67 69 6e 7b 71 75 | 6f 74 65 7d 0a 5c 62 65 |begin{qu|ote}.\be|
|00001da0| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 28 73 |gin{verb|atim}.(s|
|00001db0| 65 74 21 20 28 79 2d 73 | 63 72 6f 6c 6c 2d 63 6f |et! (y-s|croll-co|
|00001dc0| 6d 6d 61 6e 64 20 6c 29 | 20 0a 20 20 20 20 20 20 |mmand l)| . |
|00001dd0| 28 66 6f 72 6d 61 74 20 | 23 66 20 22 73 63 72 6f |(format |#f "scro|
|00001de0| 6c 6c 62 61 72 2d 73 65 | 74 21 20 7e 53 20 22 20 |llbar-se|t! ~S " |
|00001df0| 28 61 64 64 72 65 73 73 | 2d 6f 66 20 73 29 29 29 |(address|-of s)))|
|00001e00| 0a 5c 65 6e 64 7b 76 65 | 72 62 61 74 69 6d 7d 0a |.\end{ve|rbatim}.|
|00001e10| 5c 65 6e 64 7b 71 75 6f | 74 65 7d 0a 48 65 72 65 |\end{quo|te}.Here|
|00001e20| 20 61 67 61 69 6e 2c 20 | 74 68 65 20 63 6f 6d 6d | again, |the comm|
|00001e30| 61 6e 64 20 61 73 73 6f | 63 69 61 74 65 64 20 74 |and asso|ciated t|
|00001e40| 6f 20 74 68 65 20 6c 69 | 73 74 62 6f 78 20 69 73 |o the li|stbox is|
|00001e50| 20 61 20 70 61 72 74 69 | 61 6c 20 73 69 6e 63 65 | a parti|al since|
|00001e60| 20 69 74 20 77 69 6c 6c | 0a 62 65 20 63 6f 6d 70 | it will|.be comp|
|00001e70| 6c 65 74 65 64 20 62 79 | 20 54 6b 20 77 68 65 6e |leted by| Tk when|
|00001e80| 20 6e 65 65 64 65 64 2e | 0a 0a 41 73 20 77 65 20 | needed.|..As we |
|00001e90| 77 69 6c 6c 20 73 65 65 | 20 69 6e 20 61 20 6e 65 |will see| in a ne|
|00001ea0| 78 74 20 63 68 61 70 74 | 65 72 2c 20 7b 5c 65 6d |xt chapt|er, {\em|
|00001eb0| 20 63 6f 6d 70 6f 73 69 | 74 65 20 77 69 64 67 65 | composi|te widge|
|00001ec0| 74 73 7d 20 77 69 6c 6c | 20 70 65 72 6d 69 74 0a |ts} will| permit.|
|00001ed0| 74 6f 20 68 69 64 65 20 | 61 6c 6c 20 74 68 69 73 |to hide |all this|
|00001ee0| 20 73 74 75 66 66 2c 20 | 61 6e 64 20 77 65 20 77 | stuff, |and we w|
|00001ef0| 69 6c 6c 20 62 65 20 61 | 62 6c 65 20 74 6f 20 64 |ill be a|ble to d|
|00001f00| 65 66 69 6e 65 20 61 20 | 6e 65 77 20 63 6c 61 73 |efine a |new clas|
|00001f10| 73 0a 77 68 69 63 68 20 | 77 69 6c 6c 20 65 6d 62 |s.which |will emb|
|00001f20| 6f 64 79 20 61 20 6c 69 | 73 74 62 6f 78 20 61 6e |ody a li|stbox an|
|00001f30| 64 20 6f 6e 65 20 28 6f | 72 20 74 77 6f 29 20 73 |d one (o|r two) s|
|00001f40| 63 72 6f 6c 6c 62 61 72 | 2e 0a 0a 5c 73 75 62 73 |crollbar|...\subs|
|00001f50| 65 63 74 69 6f 6e 7b 44 | 65 66 69 6e 69 6e 67 20 |ection{D|efining |
|00001f60| 4d 65 6e 75 73 7d 0a 0a | 5c 73 75 62 73 75 62 73 |Menus}..|\subsubs|
|00001f70| 65 63 74 69 6f 6e 7b 4d | 65 6e 75 2d 62 75 74 74 |ection{M|enu-butt|
|00001f80| 6f 6e 73 20 61 6e 64 20 | 4d 65 6e 75 73 7d 0a 54 |ons and |Menus}.T|
|00001f90| 6b 20 70 72 6f 76 69 64 | 65 73 20 74 77 6f 20 77 |k provid|es two w|
|00001fa0| 69 64 67 65 74 73 20 66 | 6f 72 20 62 75 69 6c 64 |idgets f|or build|
|00001fb0| 69 6e 67 20 61 20 6d 65 | 6e 75 3a 20 7b 5c 65 6d |ing a me|nu: {\em|
|00001fc0| 20 6d 65 6e 75 62 75 74 | 74 6f 6e 73 7d 20 61 6e | menubut|tons} an|
|00001fd0| 64 0a 7b 5c 65 6d 20 6d | 65 6e 75 73 7d 2e 20 54 |d.{\em m|enus}. T|
|00001fe0| 68 6f 73 65 20 77 69 64 | 67 65 74 73 20 61 72 65 |hose wid|gets are|
|00001ff0| 20 61 76 61 69 6c 61 62 | 6c 65 20 74 68 72 6f 75 | availab|le throu|
|00002000| 67 68 20 74 68 65 20 7b | 5c 74 74 0a 3c 4d 65 6e |gh the {|\tt.<Men|
|00002010| 75 2d 62 75 74 74 6f 6e | 3e 7d 20 61 6e 64 20 7b |u-button|>} and {|
|00002020| 5c 74 74 20 3c 4d 65 6e | 75 3e 7d 20 63 6c 61 73 |\tt <Men|u>} clas|
|00002030| 73 65 73 2e 20 49 6e 73 | 74 61 6e 63 65 73 20 6f |ses. Ins|tances o|
|00002040| 66 20 7b 5c 74 74 0a 3c | 4d 65 6e 75 2d 62 75 74 |f {\tt.<|Menu-but|
|00002050| 74 6f 6e 3e 7d 20 63 6c | 61 73 73 20 64 69 73 70 |ton>} cl|ass disp|
|00002060| 6c 61 79 20 61 20 74 65 | 78 74 75 61 6c 20 73 74 |lay a te|xtual st|
|00002070| 72 69 6e 67 20 28 6f 72 | 20 61 20 62 69 74 6d 61 |ring (or| a bitma|
|00002080| 70 29 20 61 6e 64 20 61 | 72 65 0a 61 73 73 6f 63 |p) and a|re.assoc|
|00002090| 69 61 74 65 64 20 77 69 | 74 68 20 61 6e 20 69 6e |iated wi|th an in|
|000020a0| 73 74 61 6e 63 65 20 6f | 66 20 74 68 65 20 7b 5c |stance o|f the {\|
|000020b0| 74 74 20 3c 4d 65 6e 75 | 3e 7d 20 63 6c 61 73 73 |tt <Menu|>} class|
|000020c0| 2e 0a 0a 5c 73 75 62 73 | 75 62 73 65 63 74 69 6f |...\subs|ubsectio|
|000020d0| 6e 7b 43 72 65 61 74 69 | 6e 67 20 61 20 73 69 6d |n{Creati|ng a sim|
|000020e0| 70 6c 65 20 6d 65 6e 75 | 20 62 61 72 7d 0a 0a 54 |ple menu| bar}..T|
|000020f0| 68 65 20 6d 6f 73 74 20 | 63 75 72 72 65 6e 74 20 |he most |current |
|00002100| 74 61 73 6b 20 77 69 74 | 68 20 6d 65 6e 75 73 20 |task wit|h menus |
|00002110| 63 6f 6e 63 65 72 6e 73 | 20 6d 65 6e 75 20 62 61 |concerns| menu ba|
|00002120| 72 73 0a 62 75 69 6c 64 | 69 6e 67 2e 20 7b 5c 73 |rs.build|ing. {\s|
|00002130| 74 6b 6c 6f 73 7d 20 70 | 72 6f 76 69 64 65 73 20 |tklos} p|rovides |
|00002140| 74 68 65 20 63 6f 6e 76 | 65 6e 69 65 6e 63 65 20 |the conv|enience |
|00002150| 66 75 6e 63 74 69 6f 6e | 20 5c 49 6e 64 65 78 74 |function| \Indext|
|00002160| 74 7b 6d 61 6b 65 2d 6d | 65 6e 75 62 61 72 7d 0a |t{make-m|enubar}.|
|00002170| 74 6f 20 65 61 73 65 20 | 74 6f 20 74 68 65 20 63 |to ease |to the c|
|00002180| 6f 6e 73 74 72 75 63 74 | 69 6f 6e 20 6f 66 20 6d |onstruct|ion of m|
|00002190| 65 6e 75 20 62 61 72 73 | 2e 20 54 6f 20 69 6c 6c |enu bars|. To ill|
|000021a0| 75 73 74 72 61 74 65 20 | 68 6f 77 20 74 68 69 73 |ustrate |how this|
|000021b0| 0a 66 75 6e 63 74 69 6f | 6e 20 77 6f 72 6b 2c 20 |.functio|n work, |
|000021c0| 77 65 27 6c 6c 20 70 72 | 65 73 65 6e 74 20 74 68 |we'll pr|esent th|
|000021d0| 65 20 63 61 6c 6c 20 77 | 65 20 6d 75 73 74 20 77 |e call w|e must w|
|000021e0| 72 69 74 65 20 74 6f 20 | 70 72 6f 64 75 63 65 20 |rite to |produce |
|000021f0| 74 68 65 0a 6d 65 6e 75 | 20 62 61 72 20 6f 66 20 |the.menu| bar of |
|00002200| 46 69 67 75 72 65 7e 5c | 72 65 66 7b 4d 65 6e 75 |Figure~\|ref{Menu|
|00002210| 73 7d 2e 0a 5c 62 65 67 | 69 6e 7b 66 69 67 75 72 |s}..\beg|in{figur|
|00002220| 65 7d 0a 5c 63 65 6e 74 | 65 72 6c 69 6e 65 7b 5c |e}.\cent|erline{\|
|00002230| 65 70 73 66 69 67 7b 66 | 69 6c 65 3d 46 69 67 32 |epsfig{f|ile=Fig2|
|00002240| 2d 32 2e 65 70 73 7d 7d | 0a 5c 63 61 70 74 69 6f |-2.eps}}|.\captio|
|00002250| 6e 7b 41 20 73 69 6d 70 | 6c 65 20 6d 65 6e 75 7d |n{A simp|le menu}|
|00002260| 0a 5c 6c 61 62 65 6c 7b | 4d 65 6e 75 73 7d 0a 5c |.\label{|Menus}.\|
|00002270| 65 6e 64 7b 66 69 67 75 | 72 65 7d 0a 7b 5c 74 74 |end{figu|re}.{\tt|
|00002280| 20 4d 61 6b 65 2d 6d 65 | 6e 75 62 61 72 7d 20 69 | Make-me|nubar} i|
|00002290| 73 20 61 20 66 75 6e 63 | 74 69 6f 6e 20 77 68 69 |s a func|tion whi|
|000022a0| 63 68 20 74 61 6b 65 73 | 20 61 20 6c 69 73 74 20 |ch takes| a list |
|000022b0| 6f 66 20 6d 65 6e 75 20 | 62 75 74 74 6f 6e 73 0a |of menu |buttons.|
|000022c0| 73 70 65 63 69 66 69 63 | 61 74 69 6f 6e 73 2e 20 |specific|ations. |
|000022d0| 45 61 63 68 20 6d 65 6e | 75 20 62 75 74 74 6f 6e |Each men|u button|
|000022e0| 20 73 70 65 63 69 66 69 | 63 61 74 69 6f 6e 20 69 | specifi|cation i|
|000022f0| 73 20 61 6c 73 6f 20 61 | 20 6c 69 73 74 2e 20 20 |s also a| list. |
|00002300| 46 69 72 73 74 20 69 74 | 65 6d 0a 6f 66 20 74 68 |First it|em.of th|
|00002310| 69 73 20 6c 69 73 74 20 | 69 73 20 74 68 65 20 73 |is list |is the s|
|00002320| 70 65 63 69 66 69 63 61 | 74 69 6f 6e 20 6f 66 20 |pecifica|tion of |
|00002330| 74 68 65 20 6d 65 6e 75 | 20 62 75 74 74 6f 6e 3b |the menu| button;|
|00002340| 20 74 68 65 20 72 65 73 | 74 20 6f 66 20 74 68 69 | the res|t of thi|
|00002350| 73 20 6c 69 73 74 0a 63 | 6f 72 72 65 73 70 6f 6e |s list.c|orrespon|
|00002360| 64 20 74 6f 20 74 68 65 | 20 73 70 65 63 69 66 61 |d to the| specifa|
|00002370| 63 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 6d 65 6e |ction of| the men|
|00002380| 75 20 69 74 65 6d 73 20 | 61 73 73 6f 63 69 61 74 |u items |associat|
|00002390| 65 64 20 74 6f 20 74 68 | 69 73 20 6d 65 6e 75 0a |ed to th|is menu.|
|000023a0| 62 75 74 74 6f 6e 2e 20 | 54 6f 20 72 65 70 72 65 |button. |To repre|
|000023b0| 73 65 6e 74 20 74 68 65 | 20 6d 65 6e 75 20 62 61 |sent the| menu ba|
|000023c0| 72 20 6f 66 20 46 69 67 | 75 72 65 5c 72 65 66 7b |r of Fig|ure\ref{|
|000023d0| 4d 65 6e 75 73 7d 2c 20 | 77 65 20 68 61 76 65 20 |Menus}, |we have |
|000023e0| 61 0a 73 70 65 63 69 66 | 69 63 61 74 69 6f 6e 20 |a.specif|ication |
|000023f0| 77 68 69 68 20 6c 6f 6f | 6b 73 20 6c 69 6b 65 3a |whih loo|ks like:|
|00002400| 0a 5c 62 65 67 69 6e 7b | 71 75 6f 74 65 7d 0a 5c |.\begin{|quote}.\|
|00002410| 62 65 67 69 6e 7b 61 6c | 6c 74 74 7d 0a 09 28 28 |begin{al|ltt}..((|
|00002420| 44 65 73 63 72 69 70 74 | 69 6f 6e 20 6f 66 20 7b |Descript|ion of {|
|00002430| 5c 69 74 20 57 6f 72 6b | 20 64 61 79 73 7d 20 6d |\it Work| days} m|
|00002440| 65 6e 75 20 62 75 74 74 | 6f 6e 0a 09 20 20 20 20 |enu butt|on.. |
|00002450| 20 28 46 69 73 72 74 20 | 69 74 65 6d 20 6f 66 20 | (Fisrt |item of |
|00002460| 7b 5c 69 74 20 57 6f 72 | 6b 20 64 61 79 73 7d 29 |{\it Wor|k days})|
|00002470| 0a 09 20 20 20 20 20 28 | 53 65 63 6f 6e 64 20 69 |.. (|Second i|
|00002480| 74 65 6d 20 6f 66 20 7b | 5c 69 74 20 57 6f 72 6b |tem of {|\it Work|
|00002490| 20 64 61 79 73 7d 29 29 | 0a 09 20 28 44 65 73 63 | days}))|.. (Desc|
|000024a0| 72 69 70 74 69 6f 6e 20 | 6f 66 20 7b 5c 69 74 20 |ription |of {\it |
|000024b0| 57 65 65 6b 20 65 6e 64 | 7d 20 6d 65 6e 75 20 62 |Week end|} menu b|
|000024c0| 75 74 74 6f 6e 0a 09 20 | 20 20 20 20 28 46 69 73 |utton.. | (Fis|
|000024d0| 72 74 20 69 74 65 6d 20 | 6f 66 20 7b 5c 69 74 20 |rt item |of {\it |
|000024e0| 57 65 65 6b 2d 65 6e 64 | 7d 29 0a 09 20 20 20 20 |Week-end|}).. |
|000024f0| 20 28 53 65 63 6f 6e 64 | 20 69 74 65 6d 20 6f 66 | (Second| item of|
|00002500| 20 7b 5c 69 74 20 57 65 | 65 6b 2d 65 6e 64 7d 29 | {\it We|ek-end})|
|00002510| 29 0a 09 29 0a 5c 65 6e | 64 7b 61 6c 6c 74 74 7d |)..).\en|d{alltt}|
|00002520| 0a 5c 65 6e 64 7b 71 75 | 6f 74 65 7d 0a 54 68 65 |.\end{qu|ote}.The|
|00002530| 20 63 6f 6d 70 6c 65 74 | 65 20 63 6f 64 65 20 66 | complet|e code f|
|00002540| 6f 72 20 74 68 69 73 20 | 6d 65 6e 75 20 62 61 72 |or this |menu bar|
|00002550| 20 69 73 20 67 69 76 65 | 6e 20 69 6e 20 46 69 67 | is give|n in Fig|
|00002560| 75 72 65 5c 72 65 66 7b | 4d 65 6e 75 73 3a 63 6f |ure\ref{|Menus:co|
|00002570| 64 65 7d 2e 0a 53 74 72 | 75 74 75 72 65 20 6f 66 |de}..Str|uture of|
|00002580| 20 6d 65 6e 75 20 62 75 | 74 74 6f 6e 73 20 61 6e | menu bu|ttons an|
|00002590| 64 20 6d 65 6e 75 20 69 | 74 65 6d 73 20 73 70 65 |d menu i|tems spe|
|000025a0| 63 69 66 69 63 61 74 69 | 6f 6e 73 20 69 73 20 64 |cificati|ons is d|
|000025b0| 65 66 69 6e 65 64 20 69 | 6e 0a 5c 72 65 66 7b 6d |efined i|n.\ref{m|
|000025c0| 61 6b 65 2d 6d 65 6e 75 | 62 61 72 7d 2e 0a 5c 62 |ake-menu|bar}..\b|
|000025d0| 65 67 69 6e 7b 66 69 67 | 75 72 65 7d 0a 7b 5c 73 |egin{fig|ure}.{\s|
|000025e0| 6d 61 6c 6c 0a 5c 62 65 | 67 69 6e 7b 76 65 72 62 |mall.\be|gin{verb|
|000025f0| 61 74 69 6d 7d 0a 28 64 | 65 66 69 6e 65 20 6c 20 |atim}.(d|efine l |
|00002600| 60 28 28 22 57 6f 72 6b | 20 64 61 79 73 22 20 0a |`(("Work| days" .|
|00002610| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002620| 20 28 22 4d 6f 6e 64 61 | 79 22 20 20 20 20 2c 28 | ("Monda|y" ,(|
|00002630| 6c 61 6d 62 64 61 20 28 | 29 20 28 66 6f 72 6d 61 |lambda (|) (forma|
|00002640| 74 20 23 74 20 22 4d 6f | 6e 64 61 79 5c 6e 22 29 |t #t "Mo|nday\n")|
|00002650| 29 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |)). | |
|00002660| 20 20 20 20 28 22 54 75 | 65 73 64 61 79 22 20 20 | ("Tu|esday" |
|00002670| 20 2c 28 6c 61 6d 62 64 | 61 20 28 29 20 28 66 6f | ,(lambd|a () (fo|
|00002680| 72 6d 61 74 20 23 74 20 | 22 54 75 65 73 64 61 79 |rmat #t |"Tuesday|
|00002690| 5c 6e 22 29 29 29 0a 20 | 20 20 20 20 20 20 20 20 |\n"))). | |
|000026a0| 20 20 20 20 20 20 20 20 | 28 22 22 29 0a 20 20 20 | |(""). |
|000026b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 28 22 | | ("|
|000026c0| 57 65 64 6e 65 73 64 61 | 79 22 0a 20 20 20 20 20 |Wednesda|y". |
|000026d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000026e0| 28 28 63 6f 6d 6d 61 6e | 64 20 3a 62 69 74 6d 61 |((comman|d :bitma|
|000026f0| 70 20 65 72 72 6f 72 20 | 3a 73 74 61 74 65 20 64 |p error |:state d|
|00002700| 69 73 61 62 6c 65 64 29 | 0a 20 20 20 20 20 20 20 |isabled)|. |
|00002710| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 28 | | (|
|00002720| 22 59 65 73 22 20 2c 28 | 6c 61 6d 62 64 61 20 28 |"Yes" ,(|lambda (|
|00002730| 29 20 28 66 6f 72 6d 61 | 74 20 23 74 20 22 57 65 |) (forma|t #t "We|
|00002740| 64 6e 65 73 64 61 79 20 | 28 59 65 73 29 5c 6e 22 |dnesday |(Yes)\n"|
|00002750| 29 29 29 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |))). | |
|00002760| 20 20 20 20 20 20 20 20 | 20 20 28 22 4e 6f 22 20 | | ("No" |
|00002770| 20 2c 28 6c 61 6d 62 64 | 61 20 28 29 20 28 66 6f | ,(lambd|a () (fo|
|00002780| 72 6d 61 74 20 23 74 20 | 22 57 65 64 6e 65 73 64 |rmat #t |"Wednesd|
|00002790| 61 79 20 28 4e 6f 29 20 | 5c 6e 22 29 29 29 29 29 |ay (No) |\n")))))|
|000027a0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000027b0| 20 20 28 22 22 29 0a 20 | 20 20 20 20 20 20 20 20 | (""). | |
|000027c0| 20 20 20 20 20 20 20 20 | 28 22 54 68 75 72 73 64 | |("Thursd|
|000027d0| 61 79 22 20 20 2c 28 6c | 61 6d 62 64 61 20 28 29 |ay" ,(l|ambda ()|
|000027e0| 20 28 66 6f 72 6d 61 74 | 20 23 74 20 22 54 68 75 | (format| #t "Thu|
|000027f0| 72 73 64 61 79 5c 6e 22 | 29 29 29 0a 20 20 20 20 |rsday\n"|))). |
|00002800| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 28 22 46 | | ("F|
|00002810| 72 69 64 61 79 22 20 20 | 20 20 2c 28 6c 61 6d 62 |riday" | ,(lamb|
|00002820| 64 61 20 28 29 20 28 66 | 6f 72 6d 61 74 20 23 74 |da () (f|ormat #t|
|00002830| 20 22 46 72 69 64 61 79 | 5c 6e 22 29 29 29 29 0a | "Friday|\n")))).|
|00002840| 20 20 20 20 20 20 20 20 | 20 20 20 28 22 57 65 65 | | ("Wee|
|00002850| 6b 2d 65 6e 64 22 0a 20 | 20 20 20 20 20 20 20 20 |k-end". | |
|00002860| 20 20 20 20 20 20 20 20 | 28 22 53 61 74 75 72 64 | |("Saturd|
|00002870| 61 79 22 20 20 2c 28 6c | 61 6d 62 64 61 20 28 29 |ay" ,(l|ambda ()|
|00002880| 20 28 66 6f 72 6d 61 74 | 20 23 74 20 22 53 61 74 | (format| #t "Sat|
|00002890| 75 72 64 61 79 5c 6e 22 | 29 29 29 0a 20 20 20 20 |urday\n"|))). |
|000028a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 28 22 53 | | ("S|
|000028b0| 75 6e 64 61 79 22 20 20 | 20 20 2c 28 6c 61 6d 62 |unday" | ,(lamb|
|000028c0| 64 61 20 28 29 20 28 66 | 6f 72 6d 61 74 20 23 74 |da () (f|ormat #t|
|000028d0| 20 22 53 75 6e 64 61 79 | 5c 6e 22 29 29 29 29 29 | "Sunday|\n")))))|
|000028e0| 29 0a 0a 28 70 61 63 6b | 20 28 6d 61 6b 65 2d 6d |)..(pack| (make-m|
|000028f0| 65 6e 75 62 61 72 20 2a | 74 6f 70 2d 72 6f 6f 74 |enubar *|top-root|
|00002900| 2a 20 6c 29 29 0a 5c 65 | 6e 64 7b 76 65 72 62 61 |* l)).\e|nd{verba|
|00002910| 74 69 6d 7d 0a 7d 0a 5c | 63 61 70 74 69 6f 6e 7b |tim}.}.\|caption{|
|00002920| 43 6f 64 65 20 6f 66 20 | 6d 65 6e 75 20 6f 66 20 |Code of |menu of |
|00002930| 46 69 67 75 72 65 5c 72 | 65 66 7b 4d 65 6e 75 73 |Figure\r|ef{Menus|
|00002940| 7d 7d 0a 5c 6c 61 62 65 | 6c 7b 4d 65 6e 75 73 3a |}}.\labe|l{Menus:|
|00002950| 63 6f 64 65 7d 0a 5c 65 | 6e 64 7b 66 69 67 75 72 |code}.\e|nd{figur|
|00002960| 65 7d 0a 0a 0a 0a 0a 5c | 73 65 63 74 69 6f 6e 7b |e}.....\|section{|
|00002970| 53 69 6d 70 6c 65 20 77 | 69 64 67 65 74 73 20 63 |Simple w|idgets c|
|00002980| 6c 61 73 73 65 73 7d 0a | 25 25 25 25 25 25 25 25 |lasses}.|%%%%%%%%|
|00002990| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000029a0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000029b0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000029c0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000029d0| 25 25 25 25 25 25 0a 25 | 20 46 52 41 4d 45 0a 25 |%%%%%%.%| FRAME.%|
|000029e0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000029f0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002a00| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002a10| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002a20| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 0a 0a 5c |%%%%%%%%|%%%%%..\|
|00002a30| 73 75 62 73 65 63 74 69 | 6f 6e 7b 54 68 65 20 7b |subsecti|on{The {|
|00002a40| 5c 74 74 20 46 72 61 6d | 65 7d 20 63 6c 61 73 73 |\tt Fram|e} class|
|00002a50| 7d 0a 0a 41 20 66 72 61 | 6d 65 20 69 73 20 61 20 |}..A fra|me is a |
|00002a60| 7b 5c 73 74 6b 6c 6f 73 | 7d 20 73 69 6d 70 6c 65 |{\stklos|} simple|
|00002a70| 20 77 69 64 67 65 74 20 | 77 68 6f 73 65 20 70 72 | widget |whose pr|
|00002a80| 69 6d 61 72 79 20 70 75 | 72 70 6f 73 65 20 69 73 |imary pu|rpose is|
|00002a90| 20 74 6f 20 61 63 74 20 | 61 73 20 61 0a 73 70 61 | to act |as a.spa|
|00002aa0| 63 65 72 20 6f 72 20 63 | 6f 6e 74 61 69 6e 65 72 |cer or c|ontainer|
|00002ab0| 20 66 6f 72 20 63 6f 6d | 70 6c 65 78 20 77 69 6e | for com|plex win|
|00002ac0| 64 6f 77 20 6c 61 79 6f | 75 74 73 2e 20 41 20 66 |dow layo|uts. A f|
|00002ad0| 72 61 6d 65 20 6f 62 6a | 65 63 74 20 68 61 73 20 |rame obj|ect has |
|00002ae0| 73 65 76 65 72 61 6c 0a | 54 6b 2d 76 69 72 74 75 |several.|Tk-virtu|
|00002af0| 61 6c 20 73 6c 6f 74 73 | 20 77 68 69 63 68 20 61 |al slots| which a|
|00002b00| 72 65 20 6c 69 73 74 65 | 64 20 68 65 72 65 3a 0a |re liste|d here:.|
|00002b10| 0a 5c 62 65 67 69 6e 7b | 69 70 7d 0a 0a 5c 49 54 |.\begin{|ip}..\IT|
|00002b20| 45 4d 7b 62 61 63 6b 67 | 72 6f 75 6e 64 7d 0a 53 |EM{backg|round}.S|
|00002b30| 65 65 20 73 65 63 74 69 | 6f 6e 20 5c 72 65 66 7b |ee secti|on \ref{|
|00002b40| 62 61 63 6b 67 72 6f 75 | 6e 64 7d 2e 0a 0a 5c 49 |backgrou|nd}...\I|
|00002b50| 54 45 4d 7b 62 6f 72 64 | 65 72 2d 77 69 64 74 68 |TEM{bord|er-width|
|00002b60| 7d 0a 53 65 65 20 73 65 | 63 74 69 6f 6e 20 5c 72 |}.See se|ction \r|
|00002b70| 65 66 7b 62 6f 72 64 65 | 72 2d 77 69 64 74 68 7d |ef{borde|r-width}|
|00002b80| 2e 0a 0a 5c 49 54 45 4d | 7b 63 75 72 73 6f 72 7d |...\ITEM|{cursor}|
|00002b90| 0a 53 65 65 20 73 65 63 | 74 69 6f 6e 20 5c 72 65 |.See sec|tion \re|
|00002ba0| 66 7b 63 75 72 73 6f 72 | 7d 2e 0a 0a 5c 49 54 45 |f{cursor|}...\ITE|
|00002bb0| 4d 7b 68 65 69 67 68 74 | 7d 5c 6c 61 62 65 6c 7b |M{height|}\label{|
|00002bc0| 68 65 69 67 68 74 7d 0a | 73 70 65 63 69 66 69 65 |height}.|specifie|
|00002bd0| 73 20 74 68 65 20 64 65 | 73 69 72 65 64 20 68 65 |s the de|sired he|
|00002be0| 69 67 68 74 20 66 6f 72 | 20 74 68 65 20 77 69 6e |ight for| the win|
|00002bf0| 64 6f 77 2e 20 54 68 69 | 73 20 73 6c 6f 74 20 69 |dow. Thi|s slot i|
|00002c00| 73 20 6f 6e 6c 79 0a 75 | 73 65 64 20 69 66 20 74 |s only.u|sed if t|
|00002c10| 68 65 20 7b 5c 65 6d 20 | 67 65 6f 6d 65 74 72 79 |he {\em |geometry|
|00002c20| 7d 20 73 6c 6f 74 73 20 | 69 73 20 75 6e 73 70 65 |} slots |is unspe|
|00002c30| 63 69 66 69 65 64 2e 20 | 49 66 20 74 68 69 73 20 |cified. |If this |
|00002c40| 70 73 65 75 64 6f 2d 73 | 6c 6f 74 20 69 73 20 6c |pseudo-s|lot is l|
|00002c50| 65 73 73 20 74 68 61 6e | 20 0a 6f 72 20 65 71 75 |ess than| .or equ|
|00002c60| 61 6c 20 74 6f 20 7a 65 | 72 6f 20 28 61 6e 64 20 |al to ze|ro (and |
|00002c70| 7b 5c 65 6d 20 67 65 6f | 6d 65 74 72 79 7d 20 69 |{\em geo|metry} i|
|00002c80| 73 20 6e 6f 74 20 73 70 | 65 63 69 66 69 65 64 29 |s not sp|ecified)|
|00002c90| 20 74 68 65 6e 20 74 68 | 65 20 77 69 6e 64 6f 77 | then th|e window|
|00002ca0| 20 77 69 6c 6c 20 0a 6e | 6f 74 20 72 65 71 75 65 | will .n|ot reque|
|00002cb0| 73 74 20 61 6e 79 20 73 | 69 7a 65 20 61 74 20 61 |st any s|ize at a|
|00002cc0| 6c 6c 2e 0a 0a 5c 49 54 | 45 4d 7b 67 65 6f 6d 65 |ll...\IT|EM{geome|
|00002cd0| 74 72 79 7d 5c 6c 61 62 | 65 6c 7b 67 65 6f 6d 65 |try}\lab|el{geome|
|00002ce0| 74 72 79 7d 0a 73 70 65 | 63 69 66 69 65 73 20 74 |try}.spe|cifies t|
|00002cf0| 68 65 20 64 65 73 69 72 | 65 64 20 67 65 6f 6d 65 |he desir|ed geome|
|00002d00| 74 72 79 20 66 6f 72 20 | 74 68 65 20 77 69 64 67 |try for |the widg|
|00002d10| 65 74 27 73 20 77 69 6e | 64 6f 77 2c 20 69 6e 20 |et's win|dow, in |
|00002d20| 74 68 65 0a 66 6f 72 6d | 20 7b 5c 65 6d 20 77 69 |the.form| {\em wi|
|00002d30| 64 74 68 7d 78 7b 5c 65 | 6d 20 68 65 69 67 68 74 |dth}x{\e|m height|
|00002d40| 7d 2c 20 77 68 65 72 65 | 20 7b 5c 65 6d 20 77 69 |}, where| {\em wi|
|00002d50| 64 74 68 7d 20 69 73 20 | 74 68 65 20 64 65 73 69 |dth} is |the desi|
|00002d60| 72 65 64 0a 77 69 64 74 | 68 20 6f 66 20 74 68 65 |red.widt|h of the|
|00002d70| 20 77 69 6e 64 6f 77 20 | 61 6e 64 20 7b 5c 65 6d | window |and {\em|
|00002d80| 20 68 65 69 67 68 74 7d | 20 69 73 20 74 68 65 20 | height}| is the |
|00002d90| 64 65 73 69 72 65 64 20 | 68 65 69 67 68 74 2e 20 |desired |height. |
|00002da0| 20 54 68 65 0a 75 6e 69 | 74 73 20 66 6f 72 20 7b | The.uni|ts for {|
|00002db0| 5c 65 6d 20 77 69 64 74 | 68 7d 20 61 6e 64 20 7b |\em widt|h} and {|
|00002dc0| 5c 65 6d 20 68 65 69 67 | 68 74 7d 20 64 65 70 65 |\em heig|ht} depe|
|00002dd0| 6e 64 20 6f 6e 20 74 68 | 65 20 70 61 72 74 69 63 |nd on th|e partic|
|00002de0| 75 6c 61 72 0a 77 69 64 | 67 65 74 2e 20 20 46 6f |ular.wid|get. Fo|
|00002df0| 72 20 77 69 64 67 65 74 | 73 20 64 69 73 70 6c 61 |r widget|s displa|
|00002e00| 79 69 6e 67 20 74 65 78 | 74 20 74 68 65 20 75 6e |ying tex|t the un|
|00002e10| 69 74 73 20 61 72 65 20 | 75 73 75 61 6c 6c 79 20 |its are |usually |
|00002e20| 74 68 65 0a 73 69 7a 65 | 20 6f 66 20 74 68 65 20 |the.size| of the |
|00002e30| 63 68 61 72 61 63 74 65 | 72 73 20 69 6e 20 74 68 |characte|rs in th|
|00002e40| 65 20 66 6f 6e 74 20 62 | 65 69 6e 67 20 64 69 73 |e font b|eing dis|
|00002e50| 70 6c 61 79 65 64 3b 20 | 20 66 6f 72 20 6f 74 68 |played; | for oth|
|00002e60| 65 72 0a 77 69 64 67 65 | 74 73 20 74 68 65 20 75 |er.widge|ts the u|
|00002e70| 6e 69 74 73 20 61 72 65 | 20 75 73 75 61 6c 6c 79 |nits are| usually|
|00002e80| 20 70 69 78 65 6c 73 2e | 0a 0a 5c 49 54 45 4d 7b | pixels.|..\ITEM{|
|00002e90| 72 65 6c 69 65 66 7d 0a | 53 65 65 20 73 65 63 74 |relief}.|See sect|
|00002ea0| 69 6f 6e 20 5c 72 65 66 | 7b 72 65 6c 69 65 66 7d |ion \ref|{relief}|
|00002eb0| 2e 0a 0a 5c 49 54 45 4d | 7b 77 69 64 74 68 7d 0a |...\ITEM|{width}.|
|00002ec0| 73 70 65 63 69 66 69 65 | 73 20 74 68 65 20 64 65 |specifie|s the de|
|00002ed0| 73 69 72 65 64 20 77 69 | 64 74 68 20 66 6f 72 20 |sired wi|dth for |
|00002ee0| 74 68 65 20 77 69 6e 64 | 6f 77 2e 20 54 68 69 73 |the wind|ow. This|
|00002ef0| 20 73 6c 6f 74 20 69 73 | 20 6f 6e 6c 79 0a 75 73 | slot is| only.us|
|00002f00| 65 64 20 69 66 20 74 68 | 65 20 7b 5c 65 6d 20 67 |ed if th|e {\em g|
|00002f10| 65 6f 6d 65 74 72 79 7d | 20 73 6c 6f 74 73 20 69 |eometry}| slots i|
|00002f20| 73 20 75 6e 73 70 65 63 | 69 66 69 65 64 2e 20 49 |s unspec|ified. I|
|00002f30| 66 20 74 68 69 73 20 70 | 73 65 75 64 6f 2d 73 6c |f this p|seudo-sl|
|00002f40| 6f 74 20 69 73 20 6c 65 | 73 73 20 74 68 61 6e 20 |ot is le|ss than |
|00002f50| 0a 6f 72 20 65 71 75 61 | 6c 20 74 6f 20 7a 65 72 |.or equa|l to zer|
|00002f60| 6f 20 28 61 6e 64 20 7b | 5c 65 6d 20 20 67 65 6f |o (and {|\em geo|
|00002f70| 6d 65 74 72 79 7d 20 69 | 73 20 6e 6f 74 20 73 70 |metry} i|s not sp|
|00002f80| 65 63 69 66 69 65 64 29 | 20 74 68 65 6e 20 74 68 |ecified)| then th|
|00002f90| 65 20 77 69 6e 64 6f 77 | 20 77 69 6c 6c 20 0a 6e |e window| will .n|
|00002fa0| 6f 74 20 72 65 71 75 65 | 73 74 20 61 6e 79 20 73 |ot reque|st any s|
|00002fb0| 69 7a 65 20 61 74 20 61 | 6c 6c 2e 0a 5c 65 6e 64 |ize at a|ll..\end|
|00002fc0| 7b 69 70 7d 0a 0a 5c 6e | 6f 69 6e 64 65 6e 74 0a |{ip}..\n|oindent.|
|00002fd0| 46 75 72 74 68 65 72 6d | 6f 72 65 2c 20 74 68 65 |Furtherm|ore, the|
|00002fe0| 20 7b 5c 65 6d 20 46 72 | 61 6d 65 7d 20 63 6c 61 | {\em Fr|ame} cla|
|00002ff0| 73 73 20 61 64 6d 69 74 | 73 20 61 20 73 70 65 63 |ss admit|s a spec|
|00003000| 69 61 6c 20 69 6e 69 74 | 61 72 67 20 7b 5c 74 74 |ial init|arg {\tt|
|00003010| 20 3a 63 6c 61 73 73 7d | 20 77 68 69 63 68 0a 70 | :class}| which.p|
|00003020| 65 72 6d 69 74 73 20 74 | 6f 20 73 70 65 63 69 66 |ermits t|o specif|
|00003030| 79 20 74 68 65 20 6e 65 | 77 20 77 69 64 67 65 74 |y the ne|w widget|
|00003040| 20 58 31 31 20 72 65 73 | 6f 75 72 63 65 20 63 6c | X11 res|ource cl|
|00003050| 61 73 73 20 28 69 66 20 | 74 68 65 20 7b 5c 74 74 |ass (if |the {\tt|
|00003060| 20 3a 63 6c 61 73 73 7d | 20 69 73 0a 6e 6f 74 20 | :class}| is.not |
|00003070| 70 61 73 73 65 64 20 61 | 73 20 61 20 70 61 72 61 |passed a|s a para|
|00003080| 6d 65 74 65 72 20 64 75 | 72 69 6e 67 20 74 68 65 |meter du|ring the|
|00003090| 20 7b 5c 74 74 20 6d 61 | 6b 65 2d 69 6e 73 74 61 | {\tt ma|ke-insta|
|000030a0| 6e 63 65 7d 20 6f 66 20 | 74 68 65 20 66 72 61 6d |nce} of |the fram|
|000030b0| 65 2c 20 74 68 65 0a 77 | 69 64 67 65 74 20 72 65 |e, the.w|idget re|
|000030c0| 73 6f 75 72 63 65 20 63 | 6c 61 73 73 20 77 69 6c |source c|lass wil|
|000030d0| 6c 20 62 65 20 22 46 72 | 61 6d 65 22 29 2e 20 54 |l be "Fr|ame"). T|
|000030e0| 68 65 20 72 65 73 6f 75 | 72 63 65 20 63 6c 61 73 |he resou|rce clas|
|000030f0| 73 20 6f 66 20 61 20 77 | 69 64 67 65 74 20 63 61 |s of a w|idget ca|
|00003100| 6e 20 62 65 0a 73 70 65 | 63 69 66 69 65 64 20 6f |n be.spe|cified o|
|00003110| 6e 6c 79 20 61 74 20 69 | 6e 69 74 69 61 6c 69 7a |nly at i|nitializ|
|00003120| 61 74 69 6f 6e 2e 20 49 | 74 20 63 61 6e 20 62 65 |ation. I|t can be|
|00003130| 20 71 75 65 72 69 65 64 | 20 62 79 20 74 68 65 20 | queried| by the |
|00003140| 7b 5c 74 74 20 63 6c 61 | 73 73 7d 20 72 65 61 64 |{\tt cla|ss} read|
|00003150| 65 72 0a 62 75 74 20 63 | 61 6e 6e 6f 74 20 62 65 |er.but c|annot be|
|00003160| 20 63 68 61 6e 67 65 64 | 2e 0a 0a 46 75 72 74 68 | changed|...Furth|
|00003170| 65 72 20 65 78 61 6d 70 | 6c 65 20 75 73 65 20 61 |er examp|le use a|
|00003180| 20 66 72 61 6d 65 20 74 | 6f 20 67 72 6f 75 70 20 | frame t|o group |
|00003190| 74 68 72 65 65 20 6c 61 | 62 65 6c 73 20 69 6e 20 |three la|bels in |
|000031a0| 61 20 73 69 6e 67 6c 65 | 20 6f 62 6a 65 63 74 2e |a single| object.|
|000031b0| 20 48 65 72 65 2c 0a 74 | 68 65 20 74 77 6f 20 0a | Here,.t|he two .|
|000031c0| 5c 62 65 67 69 6e 7b 76 | 65 72 62 61 74 69 6d 7d |\begin{v|erbatim}|
|000031d0| 0a 28 73 65 74 71 20 66 | 20 28 6d 61 6b 65 2d 69 |.(setq f| (make-i|
|000031e0| 6e 73 74 61 6e 63 65 20 | 27 46 72 61 6d 65 29 29 |nstance |'Frame))|
|000031f0| 0a 28 73 65 74 71 20 6c | 31 20 28 6d 61 6b 65 2d |.(setq l|1 (make-|
|00003200| 69 6e 73 74 61 6e 63 65 | 20 27 4c 61 62 65 6c 20 |instance| 'Label |
|00003210| 3a 70 61 72 65 6e 74 20 | 66 20 3a 74 65 78 74 20 |:parent |f :text |
|00003220| 22 20 4c 61 62 65 6c 20 | 31 20 22 20 3a 72 65 6c |" Label |1 " :rel|
|00003230| 69 65 66 20 3a 72 61 69 | 73 65 64 20 0a 20 20 20 |ief :rai|sed . |
|00003240| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003250| 20 20 20 20 20 20 20 20 | 20 20 20 20 3a 6d 61 70 | | :map|
|00003260| 20 27 28 3a 70 6f 73 69 | 74 69 6f 6e 20 3a 6c 65 | '(:posi|tion :le|
|00003270| 66 74 29 29 29 0a 28 73 | 65 74 71 20 6c 32 20 28 |ft))).(s|etq l2 (|
|00003280| 6d 61 6b 65 2d 69 6e 73 | 74 61 6e 63 65 20 27 4c |make-ins|tance 'L|
|00003290| 61 62 65 6c 20 3a 70 61 | 72 65 6e 74 20 66 20 3a |abel :pa|rent f :|
|000032a0| 74 65 78 74 20 22 20 4c | 61 62 65 6c 20 32 20 22 |text " L|abel 2 "|
|000032b0| 20 3a 72 65 6c 69 65 66 | 20 3a 72 61 69 73 65 64 | :relief| :raised|
|000032c0| 20 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | . | |
|000032d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000032e0| 20 3a 6d 61 70 20 27 28 | 3a 70 6f 73 69 74 69 6f | :map '(|:positio|
|000032f0| 6e 20 3a 6c 65 66 74 29 | 29 29 0a 28 73 65 74 71 |n :left)|)).(setq|
|00003300| 20 6c 33 20 28 6d 61 6b | 65 2d 69 6e 73 74 61 6e | l3 (mak|e-instan|
|00003310| 63 65 20 27 4c 61 62 65 | 6c 20 3a 74 65 78 74 20 |ce 'Labe|l :text |
|00003320| 22 20 4c 61 62 65 6c 20 | 33 20 22 20 3a 72 65 6c |" Label |3 " :rel|
|00003330| 69 65 66 20 3a 72 61 69 | 73 65 64 29 29 0a 5c 65 |ief :rai|sed)).\e|
|00003340| 6e 64 7b 76 65 72 62 61 | 74 69 6d 7d 0a 0a 25 25 |nd{verba|tim}..%%|
|00003350| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003360| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003370| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003380| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003390| 25 25 25 25 25 25 25 25 | 25 25 25 25 0a 25 20 4c |%%%%%%%%|%%%%.% L|
|000033a0| 41 42 45 4c 0a 25 25 25 | 25 25 25 25 25 25 25 25 |ABEL.%%%|%%%%%%%%|
|000033b0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000033c0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000033d0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000033e0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000033f0| 25 25 25 0a 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |%%%.\sub|section{|
|00003400| 54 68 65 20 6c 61 62 65 | 6c 20 63 6c 61 73 73 7d |The labe|l class}|
|00003410| 0a 0a 54 68 65 20 7b 5c | 65 6d 20 4c 61 62 65 6c |..The {\|em Label|
|00003420| 7d 20 63 6c 61 73 73 20 | 64 65 66 69 6e 65 73 20 |} class |defines |
|00003430| 77 69 64 67 65 74 73 20 | 77 68 69 63 68 20 61 72 |widgets |which ar|
|00003440| 65 20 63 61 70 61 62 6c | 65 20 74 6f 20 64 69 73 |e capabl|e to dis|
|00003450| 70 6c 61 79 20 61 20 74 | 65 78 74 75 61 6c 0a 73 |play a t|extual.s|
|00003460| 74 72 69 6e 67 20 6f 72 | 20 61 20 62 69 74 6d 61 |tring or| a bitma|
|00003470| 70 2e 20 41 20 6c 61 62 | 65 6c 20 6f 62 6a 65 63 |p. A lab|el objec|
|00003480| 74 20 68 61 73 20 73 65 | 76 65 72 61 6c 20 70 73 |t has se|veral ps|
|00003490| 65 75 64 6f 2d 73 6c 6f | 74 73 20 77 68 69 63 68 |eudo-slo|ts which|
|000034a0| 20 61 72 65 20 6c 69 73 | 74 65 64 20 68 65 72 65 | are lis|ted here|
|000034b0| 3a 0a 5c 62 65 67 69 6e | 7b 69 70 7d 0a 0a 5c 49 |:.\begin|{ip}..\I|
|000034c0| 54 45 4d 7b 61 6e 63 68 | 6f 72 7d 5c 6c 61 62 65 |TEM{anch|or}\labe|
|000034d0| 6c 7b 61 6e 63 68 6f 72 | 7d 0a 73 70 65 63 69 66 |l{anchor|}.specif|
|000034e0| 69 65 73 20 68 6f 77 20 | 74 68 65 20 69 6e 66 6f |ies how |the info|
|000034f0| 72 6d 61 74 69 6f 6e 20 | 69 6e 20 61 20 77 69 64 |rmation |in a wid|
|00003500| 67 65 74 20 28 65 2e 67 | 2e 20 74 65 78 74 20 6f |get (e.g|. text o|
|00003510| 72 20 61 20 62 69 74 6d | 61 70 29 20 69 73 20 74 |r a bitm|ap) is t|
|00003520| 6f 20 62 65 0a 64 69 73 | 70 6c 61 79 65 64 20 69 |o be.dis|played i|
|00003530| 6e 20 74 68 65 20 77 69 | 64 67 65 74 2e 20 4d 75 |n the wi|dget. Mu|
|00003540| 73 74 20 62 65 20 6f 6e | 65 20 6f 66 20 74 68 65 |st be on|e of the|
|00003550| 20 76 61 6c 75 65 73 20 | 7b 5c 65 6d 20 3a 6e 7d | values |{\em :n}|
|00003560| 2c 20 7b 5c 65 6d 20 3a | 6e 65 7d 2c 20 7b 5c 65 |, {\em :|ne}, {\e|
|00003570| 6d 0a 3a 65 7d 2c 20 7b | 5c 65 6d 20 3a 73 65 7d |m.:e}, {|\em :se}|
|00003580| 2c 20 7b 5c 65 6d 20 3a | 73 7d 2c 20 7b 5c 65 6d |, {\em :|s}, {\em|
|00003590| 20 3a 73 77 7d 2c 20 7b | 5c 65 6d 20 3a 77 7d 2c | :sw}, {|\em :w},|
|000035a0| 20 7b 5c 65 6d 20 3a 6e | 77 7d 2c 20 6f 72 20 7b | {\em :n|w}, or {|
|000035b0| 5c 65 6d 20 60 3a 63 65 | 6e 74 65 72 7d 2e 20 20 |\em `:ce|nter}. |
|000035c0| 46 6f 72 0a 65 78 61 6d | 70 6c 65 2c 20 7b 5c 65 |For.exam|ple, {\e|
|000035d0| 6d 20 3a 6e 77 7d 20 6d | 65 61 6e 73 20 64 69 73 |m :nw} m|eans dis|
|000035e0| 70 6c 61 79 20 74 68 65 | 20 69 6e 66 6f 72 6d 61 |play the| informa|
|000035f0| 74 69 6f 6e 20 73 75 63 | 68 20 74 68 61 74 20 69 |tion suc|h that i|
|00003600| 74 73 20 74 6f 70 2d 6c | 65 66 74 20 63 6f 72 6e |ts top-l|eft corn|
|00003610| 65 72 0a 69 73 20 61 74 | 20 74 68 65 20 74 6f 70 |er.is at| the top|
|00003620| 2d 6c 65 66 74 20 63 6f | 72 6e 65 72 20 6f 66 20 |-left co|rner of |
|00003630| 74 68 65 20 77 69 64 67 | 65 74 2e 0a 0a 5c 49 54 |the widg|et...\IT|
|00003640| 45 4d 7b 62 61 63 6b 67 | 72 6f 75 6e 64 7d 0a 53 |EM{backg|round}.S|
|00003650| 65 65 20 73 65 63 74 69 | 6f 6e 20 5c 72 65 66 7b |ee secti|on \ref{|
|00003660| 62 61 63 6b 67 72 6f 75 | 6e 64 7d 2e 0a 0a 5c 49 |backgrou|nd}...\I|
|00003670| 54 45 4d 7b 62 69 74 6d | 61 70 7d 5c 6c 61 62 65 |TEM{bitm|ap}\labe|
|00003680| 6c 7b 62 69 74 6d 61 70 | 7d 0a 73 70 65 63 69 66 |l{bitmap|}.specif|
|00003690| 69 65 73 20 61 20 73 74 | 72 69 6e 67 20 63 6f 6e |ies a st|ring con|
|000036a0| 74 61 69 6e 69 6e 67 20 | 74 68 65 20 66 69 6c 65 |taining |the file|
|000036b0| 20 6e 61 6d 65 20 6f 66 | 20 74 68 65 20 62 69 74 | name of| the bit|
|000036c0| 6d 61 70 20 74 6f 20 64 | 69 73 70 6c 61 79 20 69 |map to d|isplay i|
|000036d0| 6e 20 74 68 65 0a 77 69 | 64 67 65 74 2e 20 54 68 |n the.wi|dget. Th|
|000036e0| 65 20 65 78 61 63 74 20 | 77 61 79 20 69 6e 20 77 |e exact |way in w|
|000036f0| 68 69 63 68 20 74 68 65 | 20 62 69 74 6d 61 70 20 |hich the| bitmap |
|00003700| 69 73 20 64 69 73 70 6c | 61 79 65 64 20 6d 61 79 |is displ|ayed may|
|00003710| 20 62 65 20 61 66 66 65 | 63 74 65 64 20 62 79 0a | be affe|cted by.|
|00003720| 6f 74 68 65 72 20 73 6c | 6f 74 73 20 76 61 6c 75 |other sl|ots valu|
|00003730| 65 73 20 73 75 63 68 20 | 61 73 20 7b 5c 65 6d 20 |es such |as {\em |
|00003740| 61 6e 63 68 6f 72 7d 20 | 6f 72 20 7b 5c 65 6d 20 |anchor} |or {\em |
|00003750| 6a 75 73 74 69 66 79 7d | 2e 20 20 54 79 70 69 63 |justify}|. Typic|
|00003760| 61 6c 6c 79 2c 20 69 66 | 20 74 68 69 73 0a 73 6c |ally, if| this.sl|
|00003770| 6f 74 20 69 73 20 6e 6f | 6e 20 7b 5c 74 74 20 6e |ot is no|n {\tt n|
|00003780| 69 6c 7d 20 69 73 20 73 | 70 65 63 69 66 69 65 64 |il} is s|pecified|
|00003790| 20 74 68 65 6e 20 69 74 | 20 6f 76 65 72 72 69 64 | then it| overrid|
|000037a0| 65 73 20 6f 74 68 65 72 | 20 70 73 65 75 64 6f 2d |es other| pseudo-|
|000037b0| 73 6c 6f 74 73 20 74 68 | 61 74 0a 73 70 65 63 69 |slots th|at.speci|
|000037c0| 66 79 20 61 20 74 65 78 | 74 75 61 6c 20 76 61 6c |fy a tex|tual val|
|000037d0| 75 65 20 74 6f 20 64 69 | 73 70 6c 61 79 20 69 6e |ue to di|splay in|
|000037e0| 20 74 68 65 20 77 69 64 | 67 65 74 3b 20 74 68 65 | the wid|get; the|
|000037f0| 20 7b 5c 65 6d 20 62 69 | 74 6d 61 70 7d 20 73 6c | {\em bi|tmap} sl|
|00003800| 6f 74 20 6d 61 79 20 62 | 65 0a 72 65 73 65 74 20 |ot may b|e.reset |
|00003810| 74 6f 20 61 6e 20 65 6d | 70 74 79 20 73 74 72 69 |to an em|pty stri|
|00003820| 6e 67 20 74 6f 20 72 65 | 2d 65 6e 61 62 6c 65 20 |ng to re|-enable |
|00003830| 61 20 74 65 78 74 20 64 | 69 73 70 6c 61 79 2e 0a |a text d|isplay..|
|00003840| 0a 5c 49 54 45 4d 7b 62 | 6f 72 64 65 72 2d 77 69 |.\ITEM{b|order-wi|
|00003850| 64 74 68 7d 0a 53 65 65 | 20 73 65 63 74 69 6f 6e |dth}.See| section|
|00003860| 20 5c 72 65 66 7b 62 6f | 72 64 65 72 2d 77 69 64 | \ref{bo|rder-wid|
|00003870| 74 68 7d 2e 0a 0a 5c 49 | 54 45 4d 7b 63 75 72 73 |th}...\I|TEM{curs|
|00003880| 6f 72 7d 0a 53 65 65 20 | 73 65 63 74 69 6f 6e 20 |or}.See |section |
|00003890| 5c 72 65 66 7b 63 75 72 | 73 6f 72 7d 2e 0a 0a 5c |\ref{cur|sor}...\|
|000038a0| 49 54 45 4d 7b 66 6f 6e | 74 7d 5c 6c 61 62 65 6c |ITEM{fon|t}\label|
|000038b0| 7b 66 6f 6e 74 7d 0a 73 | 70 65 63 69 66 69 65 73 |{font}.s|pecifies|
|000038c0| 20 74 68 65 20 66 6f 6e | 74 20 74 6f 20 75 73 65 | the fon|t to use|
|000038d0| 20 77 68 65 6e 20 64 72 | 61 77 69 6e 67 20 74 65 | when dr|awing te|
|000038e0| 78 74 20 69 6e 73 69 64 | 65 20 74 68 65 20 77 69 |xt insid|e the wi|
|000038f0| 64 67 65 74 2e 0a 0a 5c | 49 54 45 4d 7b 66 6f 72 |dget...\|ITEM{for|
|00003900| 65 67 72 6f 75 6e 64 7d | 5c 6c 61 62 65 6c 7b 66 |eground}|\label{f|
|00003910| 6f 72 65 67 72 6f 75 6e | 64 7d 0a 73 70 65 63 69 |oregroun|d}.speci|
|00003920| 66 69 65 73 20 74 68 65 | 20 6e 6f 72 6d 61 6c 20 |fies the| normal |
|00003930| 66 6f 72 65 67 72 6f 75 | 6e 64 20 63 6f 6c 6f 72 |foregrou|nd color|
|00003940| 20 74 6f 20 75 73 65 20 | 77 68 65 6e 20 64 69 73 | to use |when dis|
|00003950| 70 6c 61 79 69 6e 67 20 | 74 68 65 20 77 69 64 67 |playing |the widg|
|00003960| 65 74 2e 0a 0a 5c 49 54 | 45 4d 7b 68 65 69 67 68 |et...\IT|EM{heigh|
|00003970| 74 7d 0a 73 70 65 63 69 | 66 69 65 73 20 61 20 64 |t}.speci|fies a d|
|00003980| 65 73 69 72 65 64 20 68 | 65 69 67 68 74 20 66 6f |esired h|eight fo|
|00003990| 72 20 74 68 65 20 6c 61 | 62 65 6c 2e 20 20 49 66 |r the la|bel. If|
|000039a0| 20 61 20 62 69 74 6d 61 | 70 20 69 73 20 62 65 69 | a bitma|p is bei|
|000039b0| 6e 67 20 64 69 73 70 6c | 61 79 65 64 20 69 6e 0a |ng displ|ayed in.|
|000039c0| 74 68 65 20 6c 61 62 65 | 6c 20 74 68 65 6e 20 74 |the labe|l then t|
|000039d0| 68 65 20 76 61 6c 75 65 | 20 69 73 20 69 6e 20 73 |he value| is in s|
|000039e0| 63 72 65 65 6e 20 75 6e | 69 74 73 3b 20 66 6f 72 |creen un|its; for|
|000039f0| 20 74 65 78 74 20 69 74 | 20 69 73 20 69 6e 20 6c | text it| is in l|
|00003a00| 69 6e 65 73 20 6f 66 20 | 74 65 78 74 2e 0a 49 66 |ines of |text..If|
|00003a10| 20 74 68 69 73 20 70 73 | 65 75 64 6f 2d 73 6c 6f | this ps|eudo-slo|
|00003a20| 74 20 69 73 6e 27 74 20 | 73 70 65 63 69 66 69 65 |t isn't |specifie|
|00003a30| 64 2c 20 74 68 65 20 6c | 61 62 65 6c 27 73 20 64 |d, the l|abel's d|
|00003a40| 65 73 69 72 65 64 20 68 | 65 69 67 68 74 20 69 73 |esired h|eight is|
|00003a50| 20 63 6f 6d 70 75 74 65 | 64 20 66 72 6f 6d 0a 74 | compute|d from.t|
|00003a60| 68 65 20 73 69 7a 65 20 | 6f 66 20 74 68 65 20 62 |he size |of the b|
|00003a70| 69 74 6d 61 70 20 6f 72 | 20 74 65 78 74 20 62 65 |itmap or| text be|
|00003a80| 69 6e 67 20 64 69 73 70 | 6c 61 79 65 64 20 69 6e |ing disp|layed in|
|00003a90| 20 69 74 2e 0a 0a 5c 49 | 54 45 4d 7b 70 61 64 2d | it...\I|TEM{pad-|
|00003aa0| 78 7d 5c 6c 61 62 65 6c | 7b 70 61 64 2d 78 7d 0a |x}\label|{pad-x}.|
|00003ab0| 73 70 65 63 69 66 69 65 | 73 20 61 20 6e 6f 6e 2d |specifie|s a non-|
|00003ac0| 6e 65 67 61 74 69 76 65 | 20 76 61 6c 75 65 20 69 |negative| value i|
|00003ad0| 6e 64 69 63 61 74 69 6e | 67 20 68 6f 77 20 6d 75 |ndicatin|g how mu|
|00003ae0| 63 68 20 65 78 74 72 61 | 20 73 70 61 63 65 20 74 |ch extra| space t|
|00003af0| 6f 20 72 65 71 75 65 73 | 74 20 66 6f 72 0a 74 68 |o reques|t for.th|
|00003b00| 65 20 77 69 64 67 65 74 | 20 69 6e 20 74 68 65 20 |e widget| in the |
|00003b10| 58 2d 64 69 72 65 63 74 | 69 6f 6e 2e 20 57 68 65 |X-direct|ion. Whe|
|00003b20| 6e 20 63 6f 6d 70 75 74 | 69 6e 67 20 68 6f 77 20 |n comput|ing how |
|00003b30| 6c 61 72 67 65 20 61 20 | 77 69 6e 64 6f 77 20 69 |large a |window i|
|00003b40| 74 20 6e 65 65 64 73 2c | 20 74 68 65 0a 77 69 64 |t needs,| the.wid|
|00003b50| 67 65 74 20 77 69 6c 6c | 20 61 64 64 20 74 68 69 |get will| add thi|
|00003b60| 73 20 61 6d 6f 75 6e 74 | 20 74 6f 20 74 68 65 20 |s amount| to the |
|00003b70| 77 69 64 74 68 20 69 74 | 20 77 6f 75 6c 64 20 6e |width it| would n|
|00003b80| 6f 72 6d 61 6c 6c 79 20 | 6e 65 65 64 20 28 61 73 |ormally |need (as|
|00003b90| 20 64 65 74 65 72 6d 69 | 6e 65 64 0a 62 79 20 74 | determi|ned.by t|
|00003ba0| 68 65 20 77 69 64 74 68 | 20 6f 66 20 74 68 65 20 |he width| of the |
|00003bb0| 74 68 69 6e 67 73 20 64 | 69 73 70 6c 61 79 65 64 |things d|isplayed|
|00003bc0| 20 69 6e 20 74 68 65 20 | 77 69 64 67 65 74 29 3b | in the |widget);|
|00003bd0| 20 69 66 20 74 68 65 20 | 67 65 6f 6d 65 74 72 79 | if the |geometry|
|00003be0| 20 6d 61 6e 61 67 65 72 | 0a 63 61 6e 20 73 61 74 | manager|.can sat|
|00003bf0| 69 73 66 79 20 74 68 69 | 73 20 72 65 71 75 65 73 |isfy thi|s reques|
|00003c00| 74 2c 20 74 68 65 20 77 | 69 64 67 65 74 20 77 69 |t, the w|idget wi|
|00003c10| 6c 6c 20 65 6e 64 20 75 | 70 20 77 69 74 68 20 65 |ll end u|p with e|
|00003c20| 78 74 72 61 20 69 6e 74 | 65 72 6e 61 6c 20 73 70 |xtra int|ernal sp|
|00003c30| 61 63 65 20 74 6f 0a 74 | 68 65 20 6c 65 66 74 20 |ace to.t|he left |
|00003c40| 61 6e 64 2f 6f 72 20 72 | 69 67 68 74 20 6f 66 20 |and/or r|ight of |
|00003c50| 77 68 61 74 20 69 74 20 | 64 69 73 70 6c 61 79 73 |what it |displays|
|00003c60| 20 69 6e 73 69 64 65 2e | 0a 0a 5c 49 54 45 4d 7b | inside.|..\ITEM{|
|00003c70| 70 61 64 2d 79 7d 5c 6c | 61 62 65 6c 7b 70 61 64 |pad-y}\l|abel{pad|
|00003c80| 2d 79 7d 0a 73 70 65 63 | 69 66 69 65 73 20 61 20 |-y}.spec|ifies a |
|00003c90| 6e 6f 6e 2d 6e 65 67 61 | 74 69 76 65 20 76 61 6c |non-nega|tive val|
|00003ca0| 75 65 20 69 6e 64 69 63 | 61 74 69 6e 67 20 68 6f |ue indic|ating ho|
|00003cb0| 77 20 6d 75 63 68 20 65 | 78 74 72 61 20 73 70 61 |w much e|xtra spa|
|00003cc0| 63 65 20 74 6f 20 72 65 | 71 75 65 73 74 20 66 6f |ce to re|quest fo|
|00003cd0| 72 0a 74 68 65 20 77 69 | 64 67 65 74 20 69 6e 20 |r.the wi|dget in |
|00003ce0| 74 68 65 20 59 2d 64 69 | 72 65 63 74 69 6f 6e 2e |the Y-di|rection.|
|00003cf0| 20 57 68 65 6e 20 63 6f | 6d 70 75 74 69 6e 67 20 | When co|mputing |
|00003d00| 68 6f 77 20 6c 61 72 67 | 65 20 61 20 77 69 6e 64 |how larg|e a wind|
|00003d10| 6f 77 20 69 74 20 6e 65 | 65 64 73 2c 0a 74 68 65 |ow it ne|eds,.the|
|00003d20| 20 77 69 64 67 65 74 20 | 77 69 6c 6c 20 61 64 64 | widget |will add|
|00003d30| 20 74 68 69 73 20 61 6d | 6f 75 6e 74 20 74 6f 20 | this am|ount to |
|00003d40| 74 68 65 20 68 65 69 67 | 68 74 20 69 74 20 77 6f |the heig|ht it wo|
|00003d50| 75 6c 64 20 6e 6f 72 6d | 61 6c 6c 79 20 6e 65 65 |uld norm|ally nee|
|00003d60| 64 20 28 61 73 0a 64 65 | 74 65 72 6d 69 6e 65 64 |d (as.de|termined|
|00003d70| 20 62 79 20 74 68 65 20 | 68 65 69 67 68 74 20 6f | by the |height o|
|00003d80| 66 20 74 68 65 20 74 68 | 69 6e 67 73 20 64 69 73 |f the th|ings dis|
|00003d90| 70 6c 61 79 65 64 20 69 | 6e 20 74 68 65 20 77 69 |played i|n the wi|
|00003da0| 64 67 65 74 29 3b 20 69 | 66 20 74 68 65 0a 67 65 |dget); i|f the.ge|
|00003db0| 6f 6d 65 74 72 79 20 6d | 61 6e 61 67 65 72 20 63 |ometry m|anager c|
|00003dc0| 61 6e 20 73 61 74 69 73 | 66 79 20 74 68 69 73 20 |an satis|fy this |
|00003dd0| 72 65 71 75 65 73 74 2c | 20 74 68 65 20 77 69 64 |request,| the wid|
|00003de0| 67 65 74 20 77 69 6c 6c | 20 65 6e 64 20 75 70 20 |get will| end up |
|00003df0| 77 69 74 68 20 65 78 74 | 72 61 0a 69 6e 74 65 72 |with ext|ra.inter|
|00003e00| 6e 61 6c 20 73 70 61 63 | 65 20 61 62 6f 76 65 20 |nal spac|e above |
|00003e10| 61 6e 64 2f 6f 72 20 62 | 65 6c 6f 77 20 77 68 61 |and/or b|elow wha|
|00003e20| 74 20 69 74 20 64 69 73 | 70 6c 61 79 73 20 69 6e |t it dis|plays in|
|00003e30| 73 69 64 65 2e 0a 0a 5c | 49 54 45 4d 7b 72 65 6c |side...\|ITEM{rel|
|00003e40| 69 65 66 7d 0a 53 65 65 | 20 73 65 63 74 69 6f 6e |ief}.See| section|
|00003e50| 20 5c 72 65 66 7b 72 65 | 6c 69 65 66 7d 2e 0a 0a | \ref{re|lief}...|
|00003e60| 5c 49 54 45 4d 7b 74 65 | 78 74 7d 5c 6c 61 62 65 |\ITEM{te|xt}\labe|
|00003e70| 6c 7b 74 65 78 74 7d 0a | 73 70 65 63 69 66 69 65 |l{text}.|specifie|
|00003e80| 73 20 61 20 73 74 72 69 | 6e 67 20 74 6f 20 62 65 |s a stri|ng to be|
|00003e90| 20 64 69 73 70 6c 61 79 | 65 64 20 69 6e 73 69 64 | display|ed insid|
|00003ea0| 65 20 74 68 65 20 77 69 | 64 67 65 74 2e 20 20 54 |e the wi|dget. T|
|00003eb0| 68 65 20 77 61 79 20 69 | 6e 20 77 68 69 63 68 0a |he way i|n which.|
|00003ec0| 74 68 65 20 73 74 72 69 | 6e 67 20 69 73 20 64 69 |the stri|ng is di|
|00003ed0| 73 70 6c 61 79 65 64 20 | 64 65 70 65 6e 64 73 20 |splayed |depends |
|00003ee0| 6f 6e 20 74 68 65 20 70 | 61 72 74 69 63 75 6c 61 |on the p|articula|
|00003ef0| 72 20 77 69 64 67 65 74 | 20 61 6e 64 20 6d 61 79 |r widget| and may|
|00003f00| 20 62 65 0a 64 65 74 65 | 72 6d 69 6e 65 64 20 62 | be.dete|rmined b|
|00003f10| 79 20 6f 74 68 65 72 20 | 70 73 65 75 64 6f 2d 73 |y other |pseudo-s|
|00003f20| 6c 6f 74 73 2c 20 73 75 | 63 68 20 61 73 20 7b 5c |lots, su|ch as {\|
|00003f30| 65 6d 20 61 6e 63 68 6f | 72 7d 20 6f 72 20 7b 5c |em ancho|r} or {\|
|00003f40| 65 6d 20 6a 75 73 74 69 | 66 79 7d 2e 0a 0a 5c 49 |em justi|fy}...\I|
|00003f50| 54 45 4d 7b 74 65 78 74 | 2d 76 61 72 69 61 62 6c |TEM{text|-variabl|
|00003f60| 65 7d 5c 6c 61 62 65 6c | 7b 74 65 78 74 2d 76 61 |e}\label|{text-va|
|00003f70| 72 69 61 62 6c 65 7d 0a | 73 70 65 63 69 66 69 65 |riable}.|specifie|
|00003f80| 73 20 74 68 65 20 6e 61 | 6d 65 20 6f 66 20 61 20 |s the na|me of a |
|00003f90| 76 61 72 69 61 62 6c 65 | 2e 20 54 68 65 20 76 61 |variable|. The va|
|00003fa0| 6c 75 65 20 6f 66 20 74 | 68 65 20 76 61 72 69 61 |lue of t|he varia|
|00003fb0| 62 6c 65 20 69 73 20 61 | 20 74 65 78 74 0a 73 74 |ble is a| text.st|
|00003fc0| 72 69 6e 67 20 74 6f 20 | 62 65 20 64 69 73 70 6c |ring to |be displ|
|00003fd0| 61 79 65 64 20 69 6e 73 | 69 64 65 20 74 68 65 20 |ayed ins|ide the |
|00003fe0| 77 69 64 67 65 74 3b 20 | 69 66 20 74 68 65 20 76 |widget; |if the v|
|00003ff0| 61 72 69 61 62 6c 65 20 | 76 61 6c 75 65 20 63 68 |ariable |value ch|
|00004000| 61 6e 67 65 73 0a 74 68 | 65 6e 20 74 68 65 20 77 |anges.th|en the w|
|00004010| 69 64 67 65 74 20 77 69 | 6c 6c 20 61 75 74 6f 6d |idget wi|ll autom|
|00004020| 61 74 69 63 61 6c 6c 79 | 20 75 70 64 61 74 65 20 |atically| update |
|00004030| 69 74 73 65 6c 66 20 74 | 6f 20 72 65 66 6c 65 63 |itself t|o reflec|
|00004040| 74 20 74 68 65 20 6e 65 | 77 20 76 61 6c 75 65 2e |t the ne|w value.|
|00004050| 0a 54 68 65 20 77 61 79 | 20 69 6e 20 77 68 69 63 |.The way| in whic|
|00004060| 68 20 74 68 65 20 73 74 | 72 69 6e 67 20 69 73 20 |h the st|ring is |
|00004070| 64 69 73 70 6c 61 79 65 | 64 20 69 6e 20 74 68 65 |displaye|d in the|
|00004080| 20 77 69 64 67 65 74 20 | 64 65 70 65 6e 64 73 20 | widget |depends |
|00004090| 6f 6e 20 74 68 65 0a 70 | 61 72 74 69 63 75 6c 61 |on the.p|articula|
|000040a0| 72 20 77 69 64 67 65 74 | 20 61 6e 64 20 6d 61 79 |r widget| and may|
|000040b0| 20 62 65 20 64 65 74 65 | 72 6d 69 6e 65 64 20 62 | be dete|rmined b|
|000040c0| 79 20 6f 74 68 65 72 20 | 70 73 65 75 64 6f 2d 73 |y other |pseudo-s|
|000040d0| 6c 6f 74 73 2c 20 73 75 | 63 68 20 61 73 0a 7b 5c |lots, su|ch as.{\|
|000040e0| 65 6d 20 61 6e 63 68 6f | 72 7d 20 6f 72 20 7b 5c |em ancho|r} or {\|
|000040f0| 65 6d 20 6a 75 73 74 69 | 66 79 7d 2e 20 53 65 65 |em justi|fy}. See|
|00004100| 20 62 65 6c 6f 77 20 68 | 6f 77 20 74 6f 20 75 73 | below h|ow to us|
|00004110| 65 20 74 68 69 73 20 6d | 65 63 68 61 6e 69 73 6d |e this m|echanism|
|00004120| 2e 0a 0a 5c 49 54 45 4d | 7b 77 69 64 74 68 7d 0a |...\ITEM|{width}.|
|00004130| 53 70 65 63 69 66 69 65 | 73 20 61 20 64 65 73 69 |Specifie|s a desi|
|00004140| 72 65 64 20 77 69 64 74 | 68 20 66 6f 72 20 74 68 |red widt|h for th|
|00004150| 65 20 6c 61 62 65 6c 2e | 20 49 66 20 61 20 62 69 |e label.| If a bi|
|00004160| 74 6d 61 70 20 69 73 20 | 62 65 69 6e 67 20 64 69 |tmap is |being di|
|00004170| 73 70 6c 61 79 65 64 20 | 69 6e 0a 74 68 65 20 6c |splayed |in.the l|
|00004180| 61 62 65 6c 20 74 68 65 | 6e 20 74 68 65 20 76 61 |abel the|n the va|
|00004190| 6c 75 65 20 69 73 20 69 | 6e 20 73 63 72 65 65 6e |lue is i|n screen|
|000041a0| 20 75 6e 69 74 73 3b 20 | 66 6f 72 20 74 65 78 74 | units; |for text|
|000041b0| 20 69 74 20 69 73 20 69 | 6e 20 63 68 61 72 61 63 | it is i|n charac|
|000041c0| 74 65 72 73 2e 20 20 49 | 66 0a 74 68 69 73 20 70 |ters. I|f.this p|
|000041d0| 73 65 75 64 6f 2d 73 6c | 6f 74 20 69 73 6e 27 74 |seudo-sl|ot isn't|
|000041e0| 20 73 70 65 63 69 66 69 | 65 64 2c 20 74 68 65 20 | specifi|ed, the |
|000041f0| 6c 61 62 65 6c 27 73 20 | 64 65 73 69 72 65 64 20 |label's |desired |
|00004200| 77 69 64 74 68 20 69 73 | 20 63 6f 6d 70 75 74 65 |width is| compute|
|00004210| 64 20 66 72 6f 6d 20 74 | 68 65 0a 73 69 7a 65 20 |d from t|he.size |
|00004220| 6f 66 20 74 68 65 20 62 | 69 74 6d 61 70 20 6f 72 |of the b|itmap or|
|00004230| 20 74 65 78 74 20 62 65 | 69 6e 67 20 64 69 73 70 | text be|ing disp|
|00004240| 6c 61 79 65 64 20 69 6e | 20 69 74 2e 0a 0a 5c 65 |layed in| it...\e|
|00004250| 6e 64 7b 69 70 7d 0a 0a | 25 25 25 25 25 25 25 25 |nd{ip}..|%%%%%%%%|
|00004260| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004270| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004280| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004290| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000042a0| 25 25 25 25 25 25 0a 25 | 20 4d 45 53 53 41 47 45 |%%%%%%.%| MESSAGE|
|000042b0| 0a 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |.%%%%%%%|%%%%%%%%|
|000042c0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000042d0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000042e0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000042f0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 0a |%%%%%%%%|%%%%%%%.|
|00004300| 5c 73 65 63 74 69 6f 6e | 7b 54 68 65 20 4d 65 73 |\section|{The Mes|
|00004310| 73 61 67 65 20 63 6c 61 | 73 73 7d 0a 54 68 65 20 |sage cla|ss}.The |
|00004320| 7b 5c 65 6d 20 4d 65 73 | 73 61 67 65 7d 20 63 6c |{\em Mes|sage} cl|
|00004330| 61 73 73 20 64 65 66 69 | 6e 65 73 20 77 69 64 67 |ass defi|nes widg|
|00004340| 65 74 73 20 74 68 61 74 | 20 64 69 73 70 6c 61 79 |ets that| display|
|00004350| 20 61 20 74 65 78 74 75 | 61 6c 20 73 74 72 69 6e | a textu|al strin|
|00004360| 67 2e 20 20 41 20 7b 5c | 65 6d 0a 6d 65 73 73 61 |g. A {\|em.messa|
|00004370| 67 65 7d 77 69 64 67 65 | 74 20 68 61 73 20 74 68 |ge}widge|t has th|
|00004380| 72 65 65 20 73 70 65 63 | 69 61 6c 20 66 65 61 74 |ree spec|ial feat|
|00004390| 75 72 65 73 2e 20 46 69 | 72 73 74 2c 20 69 74 20 |ures. Fi|rst, it |
|000043a0| 62 72 65 61 6b 73 20 75 | 70 20 69 74 73 20 73 74 |breaks u|p its st|
|000043b0| 72 69 6e 67 20 69 6e 74 | 6f 0a 6c 69 6e 65 73 20 |ring int|o.lines |
|000043c0| 69 6e 20 6f 72 64 65 72 | 20 74 6f 20 70 72 6f 64 |in order| to prod|
|000043d0| 75 63 65 20 61 20 67 69 | 76 65 6e 20 61 73 70 65 |uce a gi|ven aspe|
|000043e0| 63 74 20 72 61 74 69 6f | 20 66 6f 72 20 74 68 65 |ct ratio| for the|
|000043f0| 20 77 69 6e 64 6f 77 2e | 20 20 54 68 65 20 6c 69 | window.| The li|
|00004400| 6e 65 0a 62 72 65 61 6b | 73 20 61 72 65 20 63 68 |ne.break|s are ch|
|00004410| 6f 73 65 6e 20 61 74 20 | 77 6f 72 64 20 62 6f 75 |osen at |word bou|
|00004420| 6e 64 61 72 69 65 73 20 | 77 68 65 72 65 76 65 72 |ndaries |wherever|
|00004430| 20 70 6f 73 73 69 62 6c | 65 20 28 69 66 20 6e 6f | possibl|e (if no|
|00004440| 74 20 65 76 65 6e 20 61 | 20 73 69 6e 67 6c 65 0a |t even a| single.|
|00004450| 77 6f 72 64 20 77 6f 75 | 6c 64 20 66 69 74 20 6f |word wou|ld fit o|
|00004460| 6e 20 61 20 6c 69 6e 65 | 2c 20 74 68 65 6e 20 74 |n a line|, then t|
|00004470| 68 65 20 77 6f 72 64 20 | 77 69 6c 6c 20 62 65 20 |he word |will be |
|00004480| 73 70 6c 69 74 20 61 63 | 72 6f 73 73 20 6c 69 6e |split ac|ross lin|
|00004490| 65 73 29 2e 20 20 4e 65 | 77 6c 69 6e 65 0a 63 68 |es). Ne|wline.ch|
|000044a0| 61 72 61 63 74 65 72 73 | 20 69 6e 20 74 68 65 20 |aracters| in the |
|000044b0| 73 74 72 69 6e 67 20 77 | 69 6c 6c 20 66 6f 72 63 |string w|ill forc|
|000044c0| 65 20 6c 69 6e 65 20 62 | 72 65 61 6b 73 3b 20 74 |e line b|reaks; t|
|000044d0| 68 65 79 20 63 61 6e 20 | 62 65 20 75 73 65 64 2c |hey can |be used,|
|000044e0| 20 66 6f 72 0a 65 78 61 | 6d 70 6c 65 2c 20 74 6f | for.exa|mple, to|
|000044f0| 20 6c 65 61 76 65 20 62 | 6c 61 6e 6b 20 6c 69 6e | leave b|lank lin|
|00004500| 65 73 20 69 6e 20 74 68 | 65 20 64 69 73 70 6c 61 |es in th|e displa|
|00004510| 79 2e 0a 0a 54 68 65 20 | 73 65 63 6f 6e 64 20 66 |y...The |second f|
|00004520| 65 61 74 75 72 65 20 6f | 66 20 61 20 6d 65 73 73 |eature o|f a mess|
|00004530| 61 67 65 20 77 69 64 67 | 65 74 20 69 73 20 6a 75 |age widg|et is ju|
|00004540| 73 74 69 66 69 63 61 74 | 69 6f 6e 2e 20 20 54 68 |stificat|ion. Th|
|00004550| 65 20 74 65 78 74 20 6d | 61 79 20 62 65 0a 64 69 |e text m|ay be.di|
|00004560| 73 70 6c 61 79 65 64 20 | 6c 65 66 74 2d 6a 75 73 |splayed |left-jus|
|00004570| 74 69 66 69 65 64 2c 20 | 63 65 6e 74 65 72 65 64 |tified, |centered|
|00004580| 20 6f 6e 20 61 20 6c 69 | 6e 65 2d 62 79 2d 6c 69 | on a li|ne-by-li|
|00004590| 6e 65 20 62 61 73 69 73 | 2c 20 6f 72 20 72 69 67 |ne basis|, or rig|
|000045a0| 68 74 2d 6a 75 73 74 69 | 66 69 65 64 2e 0a 0a 54 |ht-justi|fied...T|
|000045b0| 68 65 20 74 68 69 72 64 | 20 66 65 61 74 75 72 65 |he third| feature|
|000045c0| 20 6f 66 20 61 20 6d 65 | 73 73 61 67 65 20 77 69 | of a me|ssage wi|
|000045d0| 64 67 65 74 20 69 73 20 | 74 68 61 74 20 69 74 20 |dget is |that it |
|000045e0| 68 61 6e 64 6c 65 73 20 | 63 6f 6e 74 72 6f 6c 20 |handles |control |
|000045f0| 63 68 61 72 61 63 74 65 | 72 73 0a 61 6e 64 20 6e |characte|rs.and n|
|00004600| 6f 6e 2d 70 72 69 6e 74 | 69 6e 67 20 63 68 61 72 |on-print|ing char|
|00004610| 61 63 74 65 72 73 20 73 | 70 65 63 69 61 6c 6c 79 |acters s|pecially|
|00004620| 2e 20 20 54 61 62 20 63 | 68 61 72 61 63 74 65 72 |. Tab c|haracter|
|00004630| 73 20 61 72 65 20 72 65 | 70 6c 61 63 65 64 20 77 |s are re|placed w|
|00004640| 69 74 68 0a 65 6e 6f 75 | 67 68 20 62 6c 61 6e 6b |ith.enou|gh blank|
|00004650| 20 73 70 61 63 65 20 74 | 6f 20 6c 69 6e 65 20 75 | space t|o line u|
|00004660| 70 20 6f 6e 20 74 68 65 | 20 6e 65 78 74 20 38 2d |p on the| next 8-|
|00004670| 63 68 61 72 61 63 74 65 | 72 20 62 6f 75 6e 64 61 |characte|r bounda|
|00004680| 72 79 2e 20 20 4e 65 77 | 6c 69 6e 65 73 0a 63 61 |ry. New|lines.ca|
|00004690| 75 73 65 20 6c 69 6e 65 | 20 62 72 65 61 6b 73 2e |use line| breaks.|
|000046a0| 20 20 4f 74 68 65 72 20 | 63 6f 6e 74 72 6f 6c 20 | Other |control |
|000046b0| 63 68 61 72 61 63 74 65 | 72 73 20 28 41 53 43 49 |characte|rs (ASCI|
|000046c0| 49 20 63 6f 64 65 20 6c | 65 73 73 20 74 68 61 6e |I code l|ess than|
|000046d0| 20 68 65 78 61 64 65 63 | 69 6d 61 6c 0a 63 6f 64 | hexadec|imal.cod|
|000046e0| 65 20 32 30 29 20 61 6e | 64 20 63 68 61 72 61 63 |e 20) an|d charac|
|000046f0| 74 65 72 73 20 6e 6f 74 | 20 64 65 66 69 6e 65 64 |ters not| defined|
|00004700| 20 69 6e 20 74 68 65 20 | 66 6f 6e 74 20 61 72 65 | in the |font are|
|00004710| 20 64 69 73 70 6c 61 79 | 65 64 20 61 73 20 61 0a | display|ed as a.|
|00004720| 66 6f 75 72 2d 63 68 61 | 72 61 63 74 65 72 20 73 |four-cha|racter s|
|00004730| 65 71 75 65 6e 63 65 20 | 5c 5c 78 7b 5c 69 74 20 |equence |\\x{\it |
|00004740| 68 68 7d 20 77 68 65 72 | 65 20 7b 5c 69 74 20 68 |hh} wher|e {\it h|
|00004750| 68 7d 20 69 73 20 74 68 | 65 20 74 77 6f 2d 64 69 |h} is th|e two-di|
|00004760| 67 69 74 0a 68 65 78 61 | 64 65 63 69 6d 61 6c 20 |git.hexa|decimal |
|00004770| 6e 75 6d 62 65 72 20 63 | 6f 72 72 65 73 70 6f 6e |number c|orrespon|
|00004780| 64 69 6e 67 20 74 6f 20 | 74 68 65 20 63 68 61 72 |ding to |the char|
|00004790| 61 63 74 65 72 2e 0a 0a | 5c 6e 6f 69 6e 64 65 6e |acter...|\noinden|
|000047a0| 74 0a 41 20 6d 65 73 73 | 61 67 65 20 6f 62 6a 65 |t.A mess|age obje|
|000047b0| 63 74 20 68 61 73 20 73 | 65 76 65 72 61 6c 20 70 |ct has s|everal p|
|000047c0| 73 65 75 64 6f 2d 73 6c | 6f 74 73 20 77 68 69 63 |seudo-sl|ots whic|
|000047d0| 68 20 61 72 65 20 6c 69 | 73 74 65 64 20 68 65 72 |h are li|sted her|
|000047e0| 65 3a 0a 5c 62 65 67 69 | 6e 7b 69 70 7d 0a 0a 5c |e:.\begi|n{ip}..\|
|000047f0| 49 54 45 4d 7b 61 6e 63 | 68 6f 72 7d 0a 28 73 65 |ITEM{anc|hor}.(se|
|00004800| 65 20 73 65 63 74 69 6f | 6e 20 5c 72 65 66 7b 61 |e sectio|n \ref{a|
|00004810| 6e 63 68 6f 72 7d 29 0a | 0a 5c 49 54 45 4d 7b 61 |nchor}).|.\ITEM{a|
|00004820| 73 70 65 63 74 7d 5c 6c | 61 62 65 6c 7b 61 73 70 |spect}\l|abel{asp|
|00004830| 65 63 74 7d 0a 73 70 65 | 63 69 66 69 65 73 20 61 |ect}.spe|cifies a|
|00004840| 20 6e 6f 6e 2d 6e 65 67 | 61 74 69 76 65 20 69 6e | non-neg|ative in|
|00004850| 74 65 67 65 72 20 76 61 | 6c 75 65 20 69 6e 64 69 |teger va|lue indi|
|00004860| 63 61 74 69 6e 67 20 64 | 65 73 69 72 65 64 20 61 |cating d|esired a|
|00004870| 73 70 65 63 74 20 72 61 | 74 69 6f 20 66 6f 72 20 |spect ra|tio for |
|00004880| 74 68 65 0a 74 65 78 74 | 2e 20 54 68 65 20 61 73 |the.text|. The as|
|00004890| 70 65 63 74 20 72 61 74 | 69 6f 20 69 73 20 73 70 |pect rat|io is sp|
|000048a0| 65 63 69 66 69 65 64 20 | 61 73 20 31 30 30 2a 77 |ecified |as 100*w|
|000048b0| 69 64 74 68 2f 68 65 69 | 67 68 74 2e 20 31 30 30 |idth/hei|ght. 100|
|000048c0| 20 6d 65 61 6e 73 20 74 | 68 65 20 74 65 78 74 0a | means t|he text.|
|000048d0| 73 68 6f 75 6c 64 20 62 | 65 20 61 73 20 77 69 64 |should b|e as wid|
|000048e0| 65 20 61 73 20 69 74 20 | 69 73 20 74 61 6c 6c 2c |e as it |is tall,|
|000048f0| 20 32 30 30 20 6d 65 61 | 6e 73 20 74 68 65 20 74 | 200 mea|ns the t|
|00004900| 65 78 74 20 73 68 6f 75 | 6c 64 20 62 65 20 74 77 |ext shou|ld be tw|
|00004910| 69 63 65 20 61 73 20 77 | 69 64 65 20 61 73 0a 69 |ice as w|ide as.i|
|00004920| 74 20 69 73 20 74 61 6c | 6c 2c 20 35 30 20 6d 65 |t is tal|l, 50 me|
|00004930| 61 6e 73 20 74 68 65 20 | 74 65 78 74 20 73 68 6f |ans the |text sho|
|00004940| 75 6c 64 20 62 65 20 74 | 77 69 63 65 20 61 73 20 |uld be t|wice as |
|00004950| 74 61 6c 6c 20 61 73 20 | 69 74 20 69 73 20 77 69 |tall as |it is wi|
|00004960| 64 65 2c 20 61 6e 64 20 | 73 6f 0a 6f 6e 2e 20 55 |de, and |so.on. U|
|00004970| 73 65 64 20 74 6f 20 63 | 68 6f 6f 73 65 20 6c 69 |sed to c|hoose li|
|00004980| 6e 65 20 6c 65 6e 67 74 | 68 20 66 6f 72 20 74 65 |ne lengt|h for te|
|00004990| 78 74 20 69 66 20 7b 5c | 65 6d 20 77 69 64 74 68 |xt if {\|em width|
|000049a0| 7d 20 70 73 65 75 64 6f | 2d 73 6c 6f 74 20 69 73 |} pseudo|-slot is|
|000049b0| 6e 27 74 0a 73 70 65 63 | 69 66 69 65 64 2e 0a 0a |n't.spec|ified...|
|000049c0| 5c 49 54 45 4d 7b 62 61 | 63 6b 67 72 6f 75 6e 64 |\ITEM{ba|ckground|
|000049d0| 7d 0a 28 73 65 65 20 73 | 65 63 74 69 6f 6e 20 5c |}.(see s|ection \|
|000049e0| 72 65 66 7b 62 61 63 6b | 67 72 6f 75 6e 64 7d 29 |ref{back|ground})|
|000049f0| 0a 0a 5c 49 54 45 4d 7b | 62 6f 72 64 65 72 2d 77 |..\ITEM{|border-w|
|00004a00| 69 64 74 68 7d 0a 28 73 | 65 65 20 73 65 63 74 69 |idth}.(s|ee secti|
|00004a10| 6f 6e 20 5c 72 65 66 7b | 62 6f 72 64 65 72 2d 77 |on \ref{|border-w|
|00004a20| 69 64 74 68 7d 29 0a 0a | 5c 49 54 45 4d 7b 63 75 |idth})..|\ITEM{cu|
|00004a30| 72 73 6f 72 7d 0a 28 73 | 65 65 20 73 65 63 74 69 |rsor}.(s|ee secti|
|00004a40| 6f 6e 20 5c 72 65 66 7b | 63 75 72 73 6f 72 7d 29 |on \ref{|cursor})|
|00004a50| 0a 0a 5c 49 54 45 4d 7b | 66 6f 6e 74 7d 0a 28 73 |..\ITEM{|font}.(s|
|00004a60| 65 65 20 73 65 63 74 69 | 6f 6e 20 5c 72 65 66 7b |ee secti|on \ref{|
|00004a70| 66 6f 6e 74 7d 29 0a 0a | 5c 49 54 45 4d 7b 6a 75 |font})..|\ITEM{ju|
|00004a80| 73 74 69 66 79 7d 5c 6c | 61 62 65 6c 7b 6a 75 73 |stify}\l|abel{jus|
|00004a90| 74 69 66 79 7d 0a 73 70 | 65 63 69 66 69 65 73 20 |tify}.sp|ecifies |
|00004aa0| 68 6f 77 20 74 6f 20 6a | 75 73 74 69 66 79 20 6c |how to j|ustify l|
|00004ab0| 69 6e 65 73 20 6f 66 20 | 74 65 78 74 2e 20 4d 75 |ines of |text. Mu|
|00004ac0| 73 74 20 62 65 20 6f 6e | 65 20 6f 66 20 7b 5c 65 |st be on|e of {\e|
|00004ad0| 6d 20 3a 6c 65 66 74 7d | 2c 20 7b 5c 65 6d 0a 3a |m :left}|, {\em.:|
|00004ae0| 63 65 6e 74 65 72 7d 2c | 20 6f 72 20 7b 5c 65 6d |center},| or {\em|
|00004af0| 20 3a 72 69 67 68 74 7d | 2e 20 44 65 66 61 75 6c | :right}|. Defaul|
|00004b00| 74 73 20 74 6f 20 7b 5c | 65 6d 20 6c 65 66 74 7d |ts to {\|em left}|
|00004b10| 2e 20 54 68 69 73 20 70 | 73 65 75 64 6f 2d 73 6c |. This p|seudo-sl|
|00004b20| 6f 74 20 77 6f 72 6b 73 | 0a 74 6f 67 65 74 68 65 |ot works|.togethe|
|00004b30| 72 20 77 69 74 68 20 74 | 68 65 20 7b 5c 65 6d 20 |r with t|he {\em |
|00004b40| 61 6e 63 68 6f 72 7d 2c | 20 7b 5c 65 6d 20 61 73 |anchor},| {\em as|
|00004b50| 70 65 63 74 7d 2c 20 7b | 5c 65 6d 20 70 61 64 58 |pect}, {|\em padX|
|00004b60| 7d 2c 20 7b 5c 65 6d 20 | 70 61 64 59 7d 2c 20 61 |}, {\em |padY}, a|
|00004b70| 6e 64 20 7b 5c 65 6d 0a | 77 69 64 74 68 7d 20 70 |nd {\em.|width} p|
|00004b80| 73 65 75 64 6f 2d 73 6c | 6f 74 73 20 74 6f 20 70 |seudo-sl|ots to p|
|00004b90| 72 6f 76 69 64 65 20 61 | 20 76 61 72 69 65 74 79 |rovide a| variety|
|00004ba0| 20 6f 66 20 61 72 72 61 | 6e 67 65 6d 65 6e 74 73 | of arra|ngements|
|00004bb0| 20 6f 66 20 74 68 65 20 | 74 65 78 74 20 77 69 74 | of the |text wit|
|00004bc0| 68 69 6e 0a 74 68 65 20 | 77 69 6e 64 6f 77 2e 20 |hin.the |window. |
|00004bd0| 20 54 68 65 20 7b 5c 65 | 6d 20 61 73 70 65 63 74 | The {\e|m aspect|
|00004be0| 7d 20 61 6e 64 20 7b 5c | 65 6d 20 77 69 64 74 68 |} and {\|em width|
|00004bf0| 7d 20 70 73 65 75 64 6f | 2d 73 6c 6f 74 73 20 64 |} pseudo|-slots d|
|00004c00| 65 74 65 72 6d 69 6e 65 | 20 74 68 65 0a 61 6d 6f |etermine| the.amo|
|00004c10| 75 6e 74 20 6f 66 20 73 | 63 72 65 65 6e 20 73 70 |unt of s|creen sp|
|00004c20| 61 63 65 20 6e 65 65 64 | 65 64 20 74 6f 20 64 69 |ace need|ed to di|
|00004c30| 73 70 6c 61 79 20 74 68 | 65 20 74 65 78 74 2e 20 |splay th|e text. |
|00004c40| 20 54 68 65 20 7b 5c 65 | 6d 20 61 6e 63 68 6f 72 | The {\e|m anchor|
|00004c50| 7d 2c 20 7b 5c 65 6d 0a | 70 61 64 58 7d 2c 20 61 |}, {\em.|padX}, a|
|00004c60| 6e 64 20 7b 5c 65 6d 20 | 70 61 64 59 7d 20 70 73 |nd {\em |padY} ps|
|00004c70| 65 75 64 6f 2d 73 6c 6f | 74 73 20 64 65 74 65 72 |eudo-slo|ts deter|
|00004c80| 6d 69 6e 65 20 77 68 65 | 72 65 20 74 68 69 73 20 |mine whe|re this |
|00004c90| 72 65 63 74 61 6e 67 75 | 6c 61 72 20 61 72 65 61 |rectangu|lar area|
|00004ca0| 20 69 73 0a 64 69 73 70 | 6c 61 79 65 64 20 77 69 | is.disp|layed wi|
|00004cb0| 74 68 69 6e 20 74 68 65 | 20 77 69 64 67 65 74 27 |thin the| widget'|
|00004cc0| 73 20 77 69 6e 64 6f 77 | 2c 20 61 6e 64 20 74 68 |s window|, and th|
|00004cd0| 65 20 7b 5c 65 6d 20 6a | 75 73 74 69 66 79 7d 20 |e {\em j|ustify} |
|00004ce0| 70 73 65 75 64 6f 2d 73 | 6c 6f 74 20 64 65 74 65 |pseudo-s|lot dete|
|00004cf0| 72 6d 69 6e 65 73 0a 68 | 6f 77 20 65 61 63 68 20 |rmines.h|ow each |
|00004d00| 6c 69 6e 65 20 69 73 20 | 64 69 73 70 6c 61 79 65 |line is |displaye|
|00004d10| 64 20 77 69 74 68 69 6e | 20 74 68 61 74 20 72 65 |d within| that re|
|00004d20| 63 74 61 6e 67 75 6c 61 | 72 20 72 65 67 69 6f 6e |ctangula|r region|
|00004d30| 2e 20 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 2c 0a |. For e|xample,.|
|00004d40| 73 75 70 70 6f 73 65 20 | 7b 5c 65 6d 20 61 6e 63 |suppose |{\em anc|
|00004d50| 68 6f 72 7d 20 69 73 20 | 7b 5c 65 6d 20 3a 65 7d |hor} is |{\em :e}|
|00004d60| 20 61 6e 64 20 7b 5c 65 | 6d 20 6a 75 73 74 69 66 | and {\e|m justif|
|00004d70| 79 7d 20 69 73 20 7b 5c | 65 6d 20 3a 6c 65 66 74 |y} is {\|em :left|
|00004d80| 7d 2c 20 61 6e 64 20 74 | 68 61 74 20 74 68 65 0a |}, and t|hat the.|
|00004d90| 6d 65 73 73 61 67 65 20 | 77 69 6e 64 6f 77 20 69 |message |window i|
|00004da0| 73 20 6d 75 63 68 20 6c | 61 72 67 65 72 20 74 68 |s much l|arger th|
|00004db0| 61 6e 20 6e 65 65 64 65 | 64 20 66 6f 72 20 74 68 |an neede|d for th|
|00004dc0| 65 20 74 65 78 74 2e 20 | 54 68 65 20 74 65 78 74 |e text. |The text|
|00004dd0| 20 77 69 6c 6c 0a 64 69 | 73 70 6c 61 79 65 64 20 | will.di|splayed |
|00004de0| 73 6f 20 74 68 61 74 20 | 74 68 65 20 6c 65 66 74 |so that |the left|
|00004df0| 20 65 64 67 65 73 20 6f | 66 20 61 6c 6c 20 74 68 | edges o|f all th|
|00004e00| 65 20 6c 69 6e 65 73 20 | 6c 69 6e 65 20 75 70 20 |e lines |line up |
|00004e10| 61 6e 64 20 74 68 65 20 | 72 69 67 68 74 20 65 64 |and the |right ed|
|00004e20| 67 65 0a 6f 66 20 74 68 | 65 20 6c 6f 6e 67 65 73 |ge.of th|e longes|
|00004e30| 74 20 6c 69 6e 65 20 69 | 73 20 7b 5c 65 6d 20 70 |t line i|s {\em p|
|00004e40| 61 64 2d 78 7d 20 66 72 | 6f 6d 20 74 68 65 20 72 |ad-x} fr|om the r|
|00004e50| 69 67 68 74 20 73 69 64 | 65 20 6f 66 20 74 68 65 |ight sid|e of the|
|00004e60| 20 77 69 6e 64 6f 77 3b | 20 74 68 65 0a 65 6e 74 | window;| the.ent|
|00004e70| 69 72 65 20 74 65 78 74 | 20 62 6c 6f 63 6b 20 77 |ire text| block w|
|00004e80| 69 6c 6c 20 62 65 20 63 | 65 6e 74 65 72 65 64 20 |ill be c|entered |
|00004e90| 69 6e 20 74 68 65 20 76 | 65 72 74 69 63 61 6c 20 |in the v|ertical |
|00004ea0| 73 70 61 6e 20 6f 66 20 | 74 68 65 20 77 69 6e 64 |span of |the wind|
|00004eb0| 6f 77 2e 0a 5c 49 54 45 | 4d 7b 70 61 64 2d 78 7d |ow..\ITE|M{pad-x}|
|00004ec0| 0a 28 73 65 65 20 73 65 | 63 74 69 6f 6e 20 5c 72 |.(see se|ction \r|
|00004ed0| 65 66 7b 70 61 64 2d 78 | 7d 29 0a 0a 5c 49 54 45 |ef{pad-x|})..\ITE|
|00004ee0| 4d 7b 70 61 64 2d 79 7d | 0a 28 73 65 65 20 73 65 |M{pad-y}|.(see se|
|00004ef0| 63 74 69 6f 6e 20 5c 72 | 65 66 7b 70 61 64 2d 79 |ction \r|ef{pad-y|
|00004f00| 7d 29 0a 0a 5c 49 54 45 | 4d 7b 72 65 6c 69 65 66 |})..\ITE|M{relief|
|00004f10| 7d 0a 28 73 65 65 20 73 | 65 63 74 69 6f 6e 20 5c |}.(see s|ection \|
|00004f20| 72 65 66 7b 72 65 6c 69 | 65 66 7d 29 0a 0a 5c 49 |ref{reli|ef})..\I|
|00004f30| 54 45 4d 7b 74 65 78 74 | 7d 0a 28 73 65 65 20 73 |TEM{text|}.(see s|
|00004f40| 65 63 74 69 6f 6e 20 5c | 72 65 66 7b 74 65 78 74 |ection \|ref{text|
|00004f50| 7d 29 0a 0a 5c 49 54 45 | 4d 7b 74 65 78 74 2d 76 |})..\ITE|M{text-v|
|00004f60| 61 72 69 61 62 6c 65 7d | 0a 28 73 65 65 20 73 65 |ariable}|.(see se|
|00004f70| 63 74 69 6f 6e 20 5c 72 | 65 66 7b 74 65 78 74 2d |ction \r|ef{text-|
|00004f80| 76 61 72 69 61 62 6c 65 | 7d 29 0a 0a 5c 49 54 45 |variable|})..\ITE|
|00004f90| 4d 7b 77 69 64 74 68 7d | 5c 6c 61 62 65 6c 7b 77 |M{width}|\label{w|
|00004fa0| 69 64 74 68 7d 0a 73 70 | 65 63 69 66 69 65 73 20 |idth}.sp|ecifies |
|00004fb0| 74 68 65 20 6c 65 6e 67 | 74 68 20 6f 66 20 6c 69 |the leng|th of li|
|00004fc0| 6e 65 73 20 69 6e 20 74 | 68 65 20 77 69 6e 64 6f |nes in t|he windo|
|00004fd0| 77 2e 20 49 66 20 74 68 | 69 73 20 70 73 65 75 64 |w. If th|is pseud|
|00004fe0| 6f 2d 73 6c 6f 74 20 68 | 61 73 20 61 20 76 61 6c |o-slot h|as a val|
|00004ff0| 75 65 0a 67 72 65 61 74 | 65 72 20 74 68 61 6e 20 |ue.great|er than |
|00005000| 7a 65 72 6f 20 74 68 65 | 6e 20 74 68 65 20 7b 5c |zero the|n the {\|
|00005010| 65 6d 20 61 73 70 65 63 | 74 7d 20 70 73 65 75 64 |em aspec|t} pseud|
|00005020| 6f 2d 73 6c 6f 74 20 69 | 73 20 69 67 6e 6f 72 65 |o-slot i|s ignore|
|00005030| 64 20 61 6e 64 20 74 68 | 65 20 7b 5c 65 6d 0a 77 |d and th|e {\em.w|
|00005040| 69 64 74 68 7d 20 70 73 | 65 75 64 6f 2d 73 6c 6f |idth} ps|eudo-slo|
|00005050| 74 20 64 65 74 65 72 6d | 69 6e 65 73 20 74 68 65 |t determ|ines the|
|00005060| 20 6c 69 6e 65 20 6c 65 | 6e 67 74 68 2e 20 20 49 | line le|ngth. I|
|00005070| 66 20 74 68 69 73 20 70 | 73 65 75 64 6f 2d 73 6c |f this p|seudo-sl|
|00005080| 6f 74 20 68 61 73 20 61 | 0a 76 61 6c 75 65 20 6c |ot has a|.value l|
|00005090| 65 73 73 20 74 68 61 6e | 20 6f 72 20 65 71 75 61 |ess than| or equa|
|000050a0| 6c 20 74 6f 20 7a 65 72 | 6f 2c 20 74 68 65 6e 20 |l to zer|o, then |
|000050b0| 74 68 65 20 7b 5c 65 6d | 20 61 73 70 65 63 74 7d |the {\em| aspect}|
|000050c0| 20 70 73 65 75 64 6f 2d | 73 6c 6f 74 20 64 65 74 | pseudo-|slot det|
|000050d0| 65 72 6d 69 6e 65 73 0a | 74 68 65 20 6c 69 6e 65 |ermines.|the line|
|000050e0| 20 6c 65 6e 67 74 68 2e | 0a 0a 5c 65 6e 64 20 7b | length.|..\end {|
|000050f0| 69 70 7d 0a 0a 25 25 25 | 25 25 25 25 25 25 25 25 |ip}..%%%|%%%%%%%%|
|00005100| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005110| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005120| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005130| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005140| 25 25 25 0a 25 20 42 55 | 54 54 4f 4e 0a 25 25 25 |%%%.% BU|TTON.%%%|
|00005150| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005160| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005170| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005180| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005190| 25 25 25 25 25 25 25 25 | 25 25 25 0a 5c 73 65 63 |%%%%%%%%|%%%.\sec|
|000051a0| 74 69 6f 6e 7b 54 68 65 | 20 42 75 74 74 6f 6e 20 |tion{The| Button |
|000051b0| 63 6c 61 73 73 7d 0a 0a | 54 68 65 20 7b 5c 65 6d |class}..|The {\em|
|000051c0| 20 42 75 74 74 6f 6e 7d | 20 63 6c 61 73 73 20 64 | Button}| class d|
|000051d0| 65 66 69 6e 65 73 20 77 | 69 64 67 65 74 73 20 74 |efines w|idgets t|
|000051e0| 68 61 74 20 64 69 73 70 | 6c 61 79 20 61 20 60 60 |hat disp|lay a ``|
|000051f0| 72 65 61 63 74 69 76 65 | 27 27 20 74 65 78 74 75 |reactive|'' textu|
|00005200| 61 6c 0a 73 74 72 69 6e | 67 20 6f 72 20 62 69 74 |al.strin|g or bit|
|00005210| 6d 61 70 2e 20 49 74 20 | 63 61 6e 20 64 69 73 70 |map. It |can disp|
|00005220| 6c 61 79 20 69 74 73 65 | 6c 66 20 69 6e 20 65 69 |lay itse|lf in ei|
|00005230| 74 68 65 72 20 6f 66 20 | 74 68 72 65 65 20 64 69 |ther of |three di|
|00005240| 66 66 65 72 65 6e 74 20 | 77 61 79 73 2c 0a 61 63 |fferent |ways,.ac|
|00005250| 63 6f 72 64 69 6e 67 20 | 74 6f 20 74 68 65 20 7b |cording |to the {|
|00005260| 5c 65 6d 20 73 74 61 74 | 65 7d 20 70 73 65 75 64 |\em stat|e} pseud|
|00005270| 6f 2d 73 6c 6f 74 3b 20 | 69 74 20 63 61 6e 20 62 |o-slot; |it can b|
|00005280| 65 20 6d 61 64 65 20 74 | 6f 20 61 70 70 65 61 72 |e made t|o appear|
|00005290| 20 72 61 69 73 65 64 2c | 0a 73 75 6e 6b 65 6e 2c | raised,|.sunken,|
|000052a0| 20 6f 72 20 66 6c 61 74 | 3b 20 61 6e 64 20 69 74 | or flat|; and it|
|000052b0| 20 63 61 6e 20 62 65 20 | 6d 61 64 65 20 74 6f 20 | can be |made to |
|000052c0| 66 6c 61 73 68 2e 20 20 | 57 68 65 6e 20 61 20 75 |flash. |When a u|
|000052d0| 73 65 72 20 69 6e 76 6f | 6b 65 73 20 74 68 65 20 |ser invo|kes the |
|000052e0| 62 75 74 74 6f 6e 0a 28 | 64 65 66 61 75 6c 74 6c |button.(|defaultl|
|000052f0| 79 2c 20 62 79 20 70 72 | 65 73 73 69 6e 67 20 6d |y, by pr|essing m|
|00005300| 6f 75 73 65 20 62 75 74 | 74 6f 6e 20 31 20 77 69 |ouse but|ton 1 wi|
|00005310| 74 68 20 74 68 65 20 63 | 75 72 73 6f 72 20 6f 76 |th the c|ursor ov|
|00005320| 65 72 20 74 68 65 20 62 | 75 74 74 6f 6e 29 2c 20 |er the b|utton), |
|00005330| 74 68 65 6e 0a 74 68 65 | 20 63 6f 6d 6d 61 6e 64 |then.the| command|
|00005340| 20 73 70 65 63 69 66 69 | 65 64 20 69 6e 20 74 68 | specifi|ed in th|
|00005350| 65 20 7b 5c 65 6d 20 63 | 6f 6d 6d 61 6e 64 7d 20 |e {\em c|ommand} |
|00005360| 70 73 65 75 64 6f 2d 73 | 6c 6f 74 20 69 73 20 69 |pseudo-s|lot is i|
|00005370| 6e 76 6f 6b 65 64 2e 20 | 53 65 76 65 72 61 6c 0a |nvoked. |Several.|
|00005380| 6d 65 74 68 6f 64 73 20 | 61 72 65 20 61 6c 73 6f |methods |are also|
|00005390| 20 64 65 66 69 6e 65 64 | 20 66 6f 72 20 62 75 74 | defined| for but|
|000053a0| 74 6f 6e 73 2e 20 54 68 | 65 79 20 61 72 65 20 70 |tons. Th|ey are p|
|000053b0| 72 65 73 65 6e 74 65 64 | 20 61 74 20 65 6e 64 20 |resented| at end |
|000053c0| 6f 66 20 63 68 61 70 74 | 65 72 2e 0a 0a 41 20 62 |of chapt|er...A b|
|000053d0| 75 74 74 6f 6e 20 6f 62 | 6a 65 63 74 20 68 61 73 |utton ob|ject has|
|000053e0| 20 73 65 76 65 72 61 6c | 20 70 73 65 75 64 6f 2d | several| pseudo-|
|000053f0| 73 6c 6f 74 73 20 77 68 | 69 63 68 20 61 72 65 20 |slots wh|ich are |
|00005400| 6c 69 73 74 65 64 20 68 | 65 72 65 3a 0a 0a 5c 62 |listed h|ere:..\b|
|00005410| 65 67 69 6e 7b 69 70 7d | 0a 0a 5c 49 54 45 4d 7b |egin{ip}|..\ITEM{|
|00005420| 61 63 74 69 76 65 2d 62 | 61 63 6b 67 72 6f 75 6e |active-b|ackgroun|
|00005430| 64 7d 5c 6c 61 62 65 6c | 7b 61 63 74 69 76 65 2d |d}\label|{active-|
|00005440| 62 61 63 6b 67 72 6f 75 | 6e 64 7d 0a 73 70 65 63 |backgrou|nd}.spec|
|00005450| 69 66 69 65 73 20 62 61 | 63 6b 67 72 6f 75 6e 64 |ifies ba|ckground|
|00005460| 20 63 6f 6c 6f 72 20 74 | 6f 20 75 73 65 20 77 68 | color t|o use wh|
|00005470| 65 6e 20 64 72 61 77 69 | 6e 67 20 61 63 74 69 76 |en drawi|ng activ|
|00005480| 65 20 65 6c 65 6d 65 6e | 74 73 2e 0a 41 6e 20 65 |e elemen|ts..An e|
|00005490| 6c 65 6d 65 6e 74 20 28 | 61 20 77 69 64 67 65 74 |lement (|a widget|
|000054a0| 20 6f 72 20 70 6f 72 74 | 69 6f 6e 20 6f 66 20 61 | or port|ion of a|
|000054b0| 20 77 69 64 67 65 74 29 | 20 69 73 20 61 63 74 69 | widget)| is acti|
|000054c0| 76 65 20 69 66 20 74 68 | 65 0a 6d 6f 75 73 65 20 |ve if th|e.mouse |
|000054d0| 63 75 72 73 6f 72 20 69 | 73 20 70 6f 73 69 74 69 |cursor i|s positi|
|000054e0| 6f 6e 65 64 20 6f 76 65 | 72 20 74 68 65 20 65 6c |oned ove|r the el|
|000054f0| 65 6d 65 6e 74 20 61 6e | 64 20 70 72 65 73 73 69 |ement an|d pressi|
|00005500| 6e 67 20 61 20 6d 6f 75 | 73 65 20 62 75 74 74 6f |ng a mou|se butto|
|00005510| 6e 0a 77 69 6c 6c 20 63 | 61 75 73 65 20 73 6f 6d |n.will c|ause som|
|00005520| 65 20 61 63 74 69 6f 6e | 20 74 6f 20 6f 63 63 75 |e action| to occu|
|00005530| 72 2e 0a 0a 5c 49 54 45 | 4d 7b 61 63 74 69 76 65 |r...\ITE|M{active|
|00005540| 2d 66 6f 72 65 67 72 6f | 75 6e 64 7d 5c 6c 61 62 |-foregro|und}\lab|
|00005550| 65 6c 7b 61 63 74 69 76 | 65 2d 66 6f 72 65 67 72 |el{activ|e-foregr|
|00005560| 6f 75 6e 64 7d 0a 73 70 | 65 63 69 66 69 65 73 20 |ound}.sp|ecifies |
|00005570| 66 6f 72 65 67 72 6f 75 | 6e 64 20 63 6f 6c 6f 72 |foregrou|nd color|
|00005580| 20 74 6f 20 75 73 65 20 | 77 68 65 6e 20 64 72 61 | to use |when dra|
|00005590| 77 69 6e 67 20 61 63 74 | 69 76 65 20 65 6c 65 6d |wing act|ive elem|
|000055a0| 65 6e 74 73 2e 0a 53 65 | 65 20 61 62 6f 76 65 20 |ents..Se|e above |
|000055b0| 66 6f 72 20 64 65 66 69 | 6e 69 74 69 6f 6e 20 6f |for defi|nition o|
|000055c0| 66 20 61 63 74 69 76 65 | 20 65 6c 65 6d 65 6e 74 |f active| element|
|000055d0| 73 2e 0a 0a 5c 49 54 45 | 4d 7b 61 6e 63 68 6f 72 |s...\ITE|M{anchor|
|000055e0| 7d 0a 28 73 65 65 20 73 | 65 63 74 69 6f 6e 20 5c |}.(see s|ection \|
|000055f0| 72 65 66 7b 61 6e 63 68 | 6f 72 7d 29 0a 0a 5c 49 |ref{anch|or})..\I|
|00005600| 54 45 4d 7b 62 61 63 6b | 67 72 6f 75 6e 64 7d 0a |TEM{back|ground}.|
|00005610| 28 73 65 65 20 73 65 63 | 74 69 6f 6e 20 5c 72 65 |(see sec|tion \re|
|00005620| 66 7b 62 61 63 6b 67 72 | 6f 75 6e 64 7d 29 0a 0a |f{backgr|ound})..|
|00005630| 5c 49 54 45 4d 7b 62 69 | 74 6d 61 70 7d 0a 28 73 |\ITEM{bi|tmap}.(s|
|00005640| 65 65 20 73 65 63 74 69 | 6f 6e 20 5c 72 65 66 7b |ee secti|on \ref{|
|00005650| 62 69 74 6d 61 70 7d 29 | 0a 0a 5c 49 54 45 4d 7b |bitmap})|..\ITEM{|
|00005660| 62 6f 72 64 65 72 2d 77 | 69 64 74 68 7d 0a 28 73 |border-w|idth}.(s|
|00005670| 65 65 20 73 65 63 74 69 | 6f 6e 20 5c 72 65 66 7b |ee secti|on \ref{|
|00005680| 62 6f 72 64 65 72 2d 77 | 69 64 74 68 7d 29 0a 0a |border-w|idth})..|
|00005690| 5c 49 54 45 4d 7b 63 6f | 6d 6d 61 6e 64 7d 5c 6c |\ITEM{co|mmand}\l|
|000056a0| 61 62 65 6c 7b 63 6f 6d | 6d 61 6e 64 7d 0a 73 70 |abel{com|mand}.sp|
|000056b0| 65 63 69 66 69 65 73 20 | 61 20 63 6f 6d 6d 61 6e |ecifies |a comman|
|000056c0| 64 20 74 6f 20 61 73 73 | 6f 63 69 61 74 65 20 77 |d to ass|ociate w|
|000056d0| 69 74 68 20 74 68 65 20 | 62 75 74 74 6f 6e 2e 20 |ith the |button. |
|000056e0| 54 68 69 73 20 63 6f 6d | 6d 61 6e 64 20 69 73 20 |This com|mand is |
|000056f0| 74 79 70 69 63 61 6c 6c | 79 0a 69 6e 76 6f 6b 65 |typicall|y.invoke|
|00005700| 64 20 77 68 65 6e 20 6d | 6f 75 73 65 20 62 75 74 |d when m|ouse but|
|00005710| 74 6f 6e 20 31 20 69 73 | 20 72 65 6c 65 61 73 65 |ton 1 is| release|
|00005720| 64 20 6f 76 65 72 20 74 | 68 65 20 62 75 74 74 6f |d over t|he butto|
|00005730| 6e 20 77 69 6e 64 6f 77 | 2e 0a 0a 5c 49 54 45 4d |n window|...\ITEM|
|00005740| 7b 63 75 72 73 6f 72 7d | 0a 28 73 65 65 20 73 65 |{cursor}|.(see se|
|00005750| 63 74 69 6f 6e 20 5c 72 | 65 66 7b 63 75 72 73 6f |ction \r|ef{curso|
|00005760| 72 7d 29 0a 0a 5c 49 54 | 45 4d 7b 64 69 73 61 62 |r})..\IT|EM{disab|
|00005770| 6c 65 64 2d 66 6f 72 65 | 67 72 6f 75 6e 64 7d 5c |led-fore|ground}\|
|00005780| 6c 61 62 65 6c 7b 64 69 | 73 61 62 6c 65 64 2d 66 |label{di|sabled-f|
|00005790| 6f 72 65 67 72 6f 75 6e | 64 7d 0a 73 70 65 63 69 |oregroun|d}.speci|
|000057a0| 66 69 65 73 20 66 6f 72 | 65 67 72 6f 75 6e 64 20 |fies for|eground |
|000057b0| 63 6f 6c 6f 72 20 74 6f | 20 75 73 65 20 77 68 65 |color to| use whe|
|000057c0| 6e 20 64 72 61 77 69 6e | 67 20 61 20 64 69 73 61 |n drawin|g a disa|
|000057d0| 62 6c 65 64 20 65 6c 65 | 6d 65 6e 74 2e 20 49 66 |bled ele|ment. If|
|000057e0| 20 74 68 65 0a 70 73 65 | 75 64 6f 2d 73 6c 6f 74 | the.pse|udo-slot|
|000057f0| 20 69 73 20 73 70 65 63 | 69 66 69 65 64 20 61 73 | is spec|ified as|
|00005800| 20 61 6e 20 65 6d 70 74 | 79 20 73 74 72 69 6e 67 | an empt|y string|
|00005810| 20 28 77 68 69 63 68 20 | 69 73 20 74 79 70 69 63 | (which |is typic|
|00005820| 61 6c 6c 79 20 74 68 65 | 20 63 61 73 65 20 6f 6e |ally the| case on|
|00005830| 0a 6d 6f 6e 6f 63 68 72 | 6f 6d 65 20 64 69 73 70 |.monochr|ome disp|
|00005840| 6c 61 79 73 29 2c 20 64 | 69 73 61 62 6c 65 64 20 |lays), d|isabled |
|00005850| 65 6c 65 6d 65 6e 74 73 | 20 61 72 65 20 64 72 61 |elements| are dra|
|00005860| 77 6e 20 77 69 74 68 20 | 74 68 65 20 6e 6f 72 6d |wn with |the norm|
|00005870| 61 6c 20 66 6f 72 65 67 | 72 6f 75 6e 64 0a 63 6f |al foreg|round.co|
|00005880| 6c 6f 72 20 62 75 74 20 | 74 68 65 79 20 61 72 65 |lor but |they are|
|00005890| 20 64 69 6d 6d 65 64 20 | 62 79 20 64 72 61 77 69 | dimmed |by drawi|
|000058a0| 6e 67 20 74 68 65 6d 20 | 77 69 74 68 20 61 20 73 |ng them |with a s|
|000058b0| 74 69 70 70 6c 65 64 20 | 66 69 6c 6c 20 70 61 74 |tippled |fill pat|
|000058c0| 74 65 72 6e 2e 0a 0a 5c | 49 54 45 4d 7b 66 6f 6e |tern...\|ITEM{fon|
|000058d0| 74 7d 0a 28 73 65 65 20 | 73 65 63 74 69 6f 6e 20 |t}.(see |section |
|000058e0| 5c 72 65 66 7b 66 6f 6e | 74 7d 29 0a 0a 5c 49 54 |\ref{fon|t})..\IT|
|000058f0| 45 4d 7b 66 6f 72 65 67 | 72 6f 75 6e 64 7d 0a 28 |EM{foreg|round}.(|
|00005900| 73 65 65 20 73 65 63 74 | 69 6f 6e 20 5c 72 65 66 |see sect|ion \ref|
|00005910| 7b 66 6f 72 65 67 72 6f | 75 6e 64 7d 29 0a 0a 5c |{foregro|und})..\|
|00005920| 49 54 45 4d 7b 68 65 69 | 67 68 74 7d 0a 73 70 65 |ITEM{hei|ght}.spe|
|00005930| 63 69 66 69 65 73 20 61 | 20 64 65 73 69 72 65 64 |cifies a| desired|
|00005940| 20 68 65 69 67 68 74 20 | 66 6f 72 20 74 68 65 20 | height |for the |
|00005950| 62 75 74 74 6f 6e 2e 20 | 49 66 20 61 20 62 69 74 |button. |If a bit|
|00005960| 6d 61 70 20 69 73 20 62 | 65 69 6e 67 20 64 69 73 |map is b|eing dis|
|00005970| 70 6c 61 79 65 64 20 69 | 6e 0a 74 68 65 20 62 75 |played i|n.the bu|
|00005980| 74 74 6f 6e 20 74 68 65 | 6e 20 74 68 65 20 76 61 |tton the|n the va|
|00005990| 6c 75 65 20 69 73 20 69 | 6e 20 73 63 72 65 65 6e |lue is i|n screen|
|000059a0| 20 75 6e 69 74 73 3b 20 | 66 6f 72 20 74 65 78 74 | units; |for text|
|000059b0| 20 69 74 20 69 73 20 69 | 6e 20 6c 69 6e 65 73 20 | it is i|n lines |
|000059c0| 6f 66 20 74 65 78 74 2e | 0a 49 66 20 74 68 69 73 |of text.|.If this|
|000059d0| 20 70 73 65 75 64 6f 2d | 73 6c 6f 74 20 69 73 6e | pseudo-|slot isn|
|000059e0| 27 74 20 73 70 65 63 69 | 66 69 65 64 2c 20 74 68 |'t speci|fied, th|
|000059f0| 65 20 62 75 74 74 6f 6e | 27 73 20 64 65 73 69 72 |e button|'s desir|
|00005a00| 65 64 20 68 65 69 67 68 | 74 20 69 73 20 63 6f 6d |ed heigh|t is com|
|00005a10| 70 75 74 65 64 20 66 72 | 6f 6d 0a 74 68 65 20 73 |puted fr|om.the s|
|00005a20| 69 7a 65 20 6f 66 20 74 | 68 65 20 62 69 74 6d 61 |ize of t|he bitma|
|00005a30| 70 20 6f 72 20 74 65 78 | 74 20 62 65 69 6e 67 20 |p or tex|t being |
|00005a40| 64 69 73 70 6c 61 79 65 | 64 20 69 6e 20 69 74 2e |displaye|d in it.|
|00005a50| 0a 0a 5c 49 54 45 4d 7b | 70 61 64 2d 78 7d 0a 28 |..\ITEM{|pad-x}.(|
|00005a60| 73 65 65 20 73 65 63 74 | 69 6f 6e 20 5c 72 65 66 |see sect|ion \ref|
|00005a70| 7b 70 61 64 2d 78 7d 29 | 0a 0a 5c 49 54 45 4d 7b |{pad-x})|..\ITEM{|
|00005a80| 70 61 64 2d 79 7d 0a 28 | 73 65 65 20 73 65 63 74 |pad-y}.(|see sect|
|00005a90| 69 6f 6e 20 5c 72 65 66 | 7b 70 61 64 2d 79 7d 29 |ion \ref|{pad-y})|
|00005aa0| 0a 0a 5c 49 54 45 4d 7b | 72 65 6c 69 65 66 7d 0a |..\ITEM{|relief}.|
|00005ab0| 28 73 65 65 20 73 65 63 | 74 69 6f 6e 20 5c 72 65 |(see sec|tion \re|
|00005ac0| 66 7b 72 65 6c 69 65 66 | 7d 29 0a 0a 5c 49 54 45 |f{relief|})..\ITE|
|00005ad0| 4d 7b 73 74 61 74 65 7d | 0a 73 70 65 63 69 66 69 |M{state}|.specifi|
|00005ae0| 65 73 20 6f 6e 65 20 6f | 66 20 74 68 72 65 65 20 |es one o|f three |
|00005af0| 73 74 61 74 65 73 20 66 | 6f 72 20 74 68 65 20 62 |states f|or the b|
|00005b00| 75 74 74 6f 6e 3a 20 20 | 7b 5c 65 6d 20 3a 6e 6f |utton: |{\em :no|
|00005b10| 72 6d 61 6c 7d 2c 20 7b | 5c 65 6d 20 3a 61 63 74 |rmal}, {|\em :act|
|00005b20| 69 76 65 7d 2c 0a 6f 72 | 20 7b 5c 65 6d 20 60 3a |ive},.or| {\em `:|
|00005b30| 64 69 73 61 62 6c 65 64 | 7d 2e 20 20 49 6e 20 6e |disabled|}. In n|
|00005b40| 6f 72 6d 61 6c 20 73 74 | 61 74 65 20 74 68 65 20 |ormal st|ate the |
|00005b50| 62 75 74 74 6f 6e 20 69 | 73 20 64 69 73 70 6c 61 |button i|s displa|
|00005b60| 79 65 64 20 75 73 69 6e | 67 20 74 68 65 0a 7b 5c |yed usin|g the.{\|
|00005b70| 65 6d 20 66 6f 72 65 67 | 72 6f 75 6e 64 7d 20 61 |em foreg|round} a|
|00005b80| 6e 64 20 7b 5c 65 6d 20 | 62 61 63 6b 67 72 6f 75 |nd {\em |backgrou|
|00005b90| 6e 64 7d 20 70 73 65 75 | 64 6f 2d 73 6c 6f 74 73 |nd} pseu|do-slots|
|00005ba0| 2e 20 20 54 68 65 20 61 | 63 74 69 76 65 20 73 74 |. The a|ctive st|
|00005bb0| 61 74 65 20 69 73 0a 74 | 79 70 69 63 61 6c 6c 79 |ate is.t|ypically|
|00005bc0| 20 75 73 65 64 20 77 68 | 65 6e 20 74 68 65 20 70 | used wh|en the p|
|00005bd0| 6f 69 6e 74 65 72 20 69 | 73 20 6f 76 65 72 20 74 |ointer i|s over t|
|00005be0| 68 65 20 62 75 74 74 6f | 6e 2e 20 20 49 6e 20 61 |he butto|n. In a|
|00005bf0| 63 74 69 76 65 20 73 74 | 61 74 65 0a 74 68 65 20 |ctive st|ate.the |
|00005c00| 62 75 74 74 6f 6e 20 69 | 73 20 64 69 73 70 6c 61 |button i|s displa|
|00005c10| 79 65 64 20 75 73 69 6e | 67 20 74 68 65 20 7b 5c |yed usin|g the {\|
|00005c20| 65 6d 20 61 63 74 69 76 | 65 46 6f 72 65 67 72 6f |em activ|eForegro|
|00005c30| 75 6e 64 7d 20 61 6e 64 | 0a 7b 5c 65 6d 20 61 63 |und} and|.{\em ac|
|00005c40| 74 69 76 65 42 61 63 6b | 67 72 6f 75 6e 64 7d 20 |tiveBack|ground} |
|00005c50| 70 73 65 75 64 6f 2d 73 | 6c 6f 74 73 2e 20 20 44 |pseudo-s|lots. D|
|00005c60| 69 73 61 62 6c 65 64 20 | 73 74 61 74 65 20 6d 65 |isabled |state me|
|00005c70| 61 6e 73 20 74 68 61 74 | 20 74 68 65 20 62 75 74 |ans that| the but|
|00005c80| 74 6f 6e 0a 69 73 20 69 | 6e 73 65 6e 73 69 74 69 |ton.is i|nsensiti|
|00005c90| 76 65 3a 20 20 69 74 20 | 64 6f 65 73 6e 27 74 20 |ve: it |doesn't |
|00005ca0| 61 63 74 69 76 61 74 65 | 20 61 6e 64 20 64 6f 65 |activate| and doe|
|00005cb0| 73 6e 27 74 20 72 65 73 | 70 6f 6e 64 20 74 6f 20 |sn't res|pond to |
|00005cc0| 6d 6f 75 73 65 0a 62 75 | 74 74 6f 6e 20 70 72 65 |mouse.bu|tton pre|
|00005cd0| 73 73 65 73 2e 20 20 49 | 6e 20 74 68 69 73 20 73 |sses. I|n this s|
|00005ce0| 74 61 74 65 20 74 68 65 | 20 7b 5c 65 6d 20 64 69 |tate the| {\em di|
|00005cf0| 73 61 62 6c 65 64 46 6f | 72 65 67 72 6f 75 6e 64 |sabledFo|reground|
|00005d00| 7d 20 61 6e 64 0a 7b 5c | 65 6d 20 62 61 63 6b 67 |} and.{\|em backg|
|00005d10| 72 6f 75 6e 64 7d 20 70 | 73 65 75 64 6f 2d 73 6c |round} p|seudo-sl|
|00005d20| 6f 74 73 20 64 65 74 65 | 72 6d 69 6e 65 20 68 6f |ots dete|rmine ho|
|00005d30| 77 20 74 68 65 20 62 75 | 74 74 6f 6e 20 69 73 20 |w the bu|tton is |
|00005d40| 64 69 73 70 6c 61 79 65 | 64 2e 0a 0a 5c 49 54 45 |displaye|d...\ITE|
|00005d50| 4d 7b 74 65 78 74 7d 0a | 28 73 65 65 20 73 65 63 |M{text}.|(see sec|
|00005d60| 74 69 6f 6e 20 5c 72 65 | 66 7b 74 65 78 74 7d 29 |tion \re|f{text})|
|00005d70| 0a 0a 5c 49 54 45 4d 7b | 74 65 78 74 2d 76 61 72 |..\ITEM{|text-var|
|00005d80| 69 61 62 6c 65 7d 0a 28 | 73 65 65 20 73 65 63 74 |iable}.(|see sect|
|00005d90| 69 6f 6e 20 5c 72 65 66 | 7b 74 65 78 74 2d 76 61 |ion \ref|{text-va|
|00005da0| 72 69 61 62 6c 65 7d 29 | 0a 0a 5c 49 54 45 4d 7b |riable})|..\ITEM{|
|00005db0| 77 69 64 74 68 7d 0a 53 | 70 65 63 69 66 69 65 73 |width}.S|pecifies|
|00005dc0| 20 61 20 64 65 73 69 72 | 65 64 20 77 69 64 74 68 | a desir|ed width|
|00005dd0| 20 66 6f 72 20 74 68 65 | 20 62 75 74 74 6f 6e 2e | for the| button.|
|00005de0| 20 20 49 66 20 61 20 62 | 69 74 6d 61 70 20 69 73 | If a b|itmap is|
|00005df0| 20 62 65 69 6e 67 20 64 | 69 73 70 6c 61 79 65 64 | being d|isplayed|
|00005e00| 20 69 6e 0a 74 68 65 20 | 62 75 74 74 6f 6e 20 74 | in.the |button t|
|00005e10| 68 65 6e 20 74 68 65 20 | 76 61 6c 75 65 20 69 73 |hen the |value is|
|00005e20| 20 69 6e 20 73 63 72 65 | 65 6e 20 75 6e 69 74 73 | in scre|en units|
|00005e30| 3b 66 6f 72 20 74 65 78 | 74 20 69 74 20 69 73 20 |;for tex|t it is |
|00005e40| 69 6e 20 63 68 61 72 61 | 63 74 65 72 73 2e 20 20 |in chara|cters. |
|00005e50| 49 66 0a 74 68 69 73 20 | 6f 70 74 69 6f 6e 20 69 |If.this |option i|
|00005e60| 73 6e 27 74 20 73 70 65 | 63 69 66 69 65 64 2c 20 |sn't spe|cified, |
|00005e70| 74 68 65 20 62 75 74 74 | 6f 6e 27 73 20 64 65 73 |the butt|on's des|
|00005e80| 69 72 65 64 20 77 69 64 | 74 68 20 69 73 20 63 6f |ired wid|th is co|
|00005e90| 6d 70 75 74 65 64 20 66 | 72 6f 6d 20 74 68 65 0a |mputed f|rom the.|
|00005ea0| 73 69 7a 65 20 6f 66 20 | 74 68 65 20 62 69 74 6d |size of |the bitm|
|00005eb0| 61 70 20 6f 72 20 74 65 | 78 74 20 62 65 69 6e 67 |ap or te|xt being|
|00005ec0| 20 64 69 73 70 6c 61 79 | 65 64 20 69 6e 20 69 74 | display|ed in it|
|00005ed0| 2e 0a 0a 5c 65 6e 64 20 | 7b 69 70 7d 0a 5c 6e 6f |...\end |{ip}.\no|
|00005ee0| 69 6e 64 65 6e 74 0a 7b | 5c 65 6d 20 45 78 61 6d |indent.{|\em Exam|
|00005ef0| 70 6c 65 7d 0a 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |ple}.The| followi|
|00005f00| 6e 67 20 65 78 61 6d 70 | 6c 65 20 73 68 6f 77 20 |ng examp|le show |
|00005f10| 61 20 73 69 6d 70 6c 65 | 20 75 73 65 20 6f 66 20 |a simple| use of |
|00005f20| 62 75 74 74 6f 6e 73 2e | 20 0a 7b 5c 74 74 20 0a |buttons.| .{\tt .|
|00005f30| 5c 62 65 67 69 6e 7b 71 | 75 6f 74 65 7d 0a 5c 62 |\begin{q|uote}.\b|
|00005f40| 65 67 69 6e 7b 76 65 72 | 62 61 74 69 6d 7d 0a 28 |egin{ver|batim}.(|
|00005f50| 73 65 74 71 20 62 31 20 | 28 6d 61 6b 65 2d 69 6e |setq b1 |(make-in|
|00005f60| 73 74 61 6e 63 65 20 27 | 42 75 74 74 6f 6e 20 3a |stance '|Button :|
|00005f70| 74 65 78 74 20 22 59 65 | 73 22 20 0a 20 20 20 20 |text "Ye|s" . |
|00005f80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005f90| 20 20 20 20 20 20 20 20 | 20 20 20 20 3a 63 6f 6d | | :com|
|00005fa0| 6d 61 6e 64 20 27 28 66 | 6f 72 6d 61 74 20 74 20 |mand '(f|ormat t |
|00005fb0| 22 59 6f 75 20 73 61 69 | 64 20 59 65 73 22 29 29 |"You sai|d Yes"))|
|00005fc0| 29 0a 28 73 65 74 71 20 | 62 32 20 28 6d 61 6b 65 |).(setq |b2 (make|
|00005fd0| 2d 69 6e 73 74 61 6e 63 | 65 20 27 42 75 74 74 6f |-instanc|e 'Butto|
|00005fe0| 6e 20 3a 74 65 78 74 20 | 22 4e 6f 22 0a 20 20 20 |n :text |"No". |
|00005ff0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00006000| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 3a 63 6f | | :co|
|00006010| 6d 6d 61 6e 64 20 27 28 | 66 6f 72 6d 61 74 20 74 |mmand '(|format t|
|00006020| 20 22 59 6f 75 20 73 61 | 69 64 20 4e 6f 22 29 29 | "You sa|id No"))|
|00006030| 29 0a 28 65 76 65 6e 74 | 2d 6c 6f 6f 70 29 0a 5c |).(event|-loop).\|
|00006040| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0a 5c 65 |end{verb|atim}.\e|
|00006050| 6e 64 7b 71 75 6f 74 65 | 7d 7d 0a 0a 25 61 6e 63 |nd{quote|}}..%anc|
|00006060| 68 6f 72 0a 25 62 61 63 | 6b 67 72 6f 75 6e 64 0a |hor.%bac|kground.|
|00006070| 25 62 69 74 6d 61 70 0a | 25 62 6f 72 64 65 72 77 |%bitmap.|%borderw|
|00006080| 69 64 74 68 0a 25 63 75 | 72 73 6f 72 0a 25 66 6f |idth.%cu|rsor.%fo|
|00006090| 6e 74 0a 25 66 6f 72 65 | 67 72 6f 75 6e 64 0a 25 |nt.%fore|ground.%|
|000060a0| 70 61 64 2d 78 0a 25 70 | 61 64 2d 79 0a 25 72 65 |pad-x.%p|ad-y.%re|
|000060b0| 6c 69 65 66 0a 25 74 65 | 78 74 0a 25 74 65 78 74 |lief.%te|xt.%text|
|000060c0| 2d 76 61 72 69 61 62 6c | 65 0a 0a 5c 73 65 63 74 |-variabl|e..\sect|
|000060d0| 69 6f 6e 20 7b 46 75 6e | 63 74 69 6f 6e 73 20 6f |ion {Fun|ctions o|
|000060e0| 66 20 74 68 69 73 20 63 | 68 61 70 74 65 72 7d 0a |f this c|hapter}.|
|000060f0| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+