home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / languages / panebasic / lib / blib2 / !TestApp / !Runim < prev    next >
Unknown  |  1992-11-14  |  6.3 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text


This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default
100% xdgMime image/x-tga default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 0d 00 0a 05 f4 0d 00 14 | 47 f4 20 20 21 54 65 73 |........|G. !Tes|
|00000010| 74 41 70 70 20 20 2d 20 | 20 41 20 74 65 73 74 20 |tApp - | A test |
|00000020| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 66 6f 72 20 |applicat|ion for |
|00000030| 64 65 6d 6f 6e 73 74 72 | 61 74 69 6e 67 20 68 6f |demonstr|ating ho|
|00000040| 77 20 74 6f 20 75 73 65 | 20 74 68 65 0d 00 1e 26 |w to use| the...&|
|00000050| f4 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00000060| 42 6c 69 62 20 49 49 20 | 6c 69 62 72 61 72 69 65 |Blib II |librarie|
|00000070| 73 2e 0d 00 28 05 f4 0d | 00 32 04 0d 00 3c 4d f4 |s...(...|.2...<M.|
|00000080| 20 20 20 46 69 72 73 74 | 20 6f 66 20 61 6c 6c 20 | First| of all |
|00000090| 69 6e 69 74 69 61 6c 69 | 73 65 20 74 68 65 20 64 |initiali|se the d|
|000000a0| 79 6e 61 6d 69 63 20 6d | 65 6d 6f 72 79 20 61 6c |ynamic m|emory al|
|000000b0| 6c 6f 63 61 74 69 6f 6e | 20 72 6f 75 74 69 6e 65 |location| routine|
|000000c0| 73 2e 20 54 68 65 73 65 | 0d 00 46 4c f4 20 20 20 |s. These|..FL. |
|000000d0| 72 6f 75 74 69 6e 65 73 | 20 61 72 65 20 75 73 65 |routines| are use|
|000000e0| 64 20 62 79 20 6d 6f 73 | 74 20 6f 66 20 74 68 65 |d by mos|t of the|
|000000f0| 20 6c 69 62 72 61 72 79 | 2c 20 73 6f 20 74 68 69 | library|, so thi|
|00000100| 73 20 69 73 20 56 45 52 | 59 20 69 6d 70 6f 72 74 |s is VER|Y import|
|00000110| 61 6e 74 2e 0d 00 50 4c | f4 20 20 20 4f 6e 20 74 |ant...PL|. On t|
|00000120| 68 69 73 20 6f 63 63 61 | 73 69 6f 6e 20 77 65 20 |his occa|sion we |
|00000130| 73 68 61 6c 6c 20 73 65 | 6c 65 63 74 20 45 52 52 |shall se|lect ERR|
|00000140| 4f 52 20 6d 65 73 73 61 | 67 65 73 20 61 6e 64 20 |OR messa|ges and |
|00000150| 74 68 65 20 4c 41 52 47 | 45 20 6d 65 6d 6f 72 79 |the LARG|E memory|
|00000160| 0d 00 5a 13 f4 20 20 20 | 61 6c 6c 6f 63 61 74 69 |..Z.. |allocati|
|00000170| 6f 6e 2e 0d 00 64 04 0d | 00 6e 10 f2 6d 65 6d 6f |on...d..|.n..memo|
|00000180| 72 79 28 b9 2c a3 29 0d | 00 78 04 0d 00 82 04 0d |ry(.,.).|.x......|
|00000190| 00 8c 4c f4 20 20 20 4e | 65 78 74 20 69 6e 69 74 |..L. N|ext init|
|000001a0| 69 61 6c 69 73 65 20 74 | 68 65 20 61 70 70 6c 69 |ialise t|he appli|
|000001b0| 63 61 74 69 6f 6e 20 77 | 69 74 68 20 74 68 65 20 |cation w|ith the |
|000001c0| 57 49 4d 50 2c 20 67 69 | 76 69 6e 67 20 74 68 65 |WIMP, gi|ving the|
|000001d0| 20 74 61 73 6b 20 6e 61 | 6d 65 2c 0d 00 96 36 f4 | task na|me,...6.|
|000001e0| 20 20 20 73 70 72 69 74 | 65 20 6e 61 6d 65 20 61 | sprit|e name a|
|000001f0| 6e 64 20 73 65 6c 65 63 | 74 69 6e 67 20 62 75 66 |nd selec|ting buf|
|00000200| 66 65 72 20 73 69 7a 65 | 20 6f 66 20 31 30 32 34 |fer size| of 1024|
|00000210| 2e 0d 00 a0 04 0d 00 aa | 32 f2 77 69 6d 70 5f 69 |........|2.wimp_i|
|00000220| 6e 69 74 28 22 54 65 73 | 74 20 41 70 70 6c 69 63 |nit("Tes|t Applic|
|00000230| 61 74 69 6f 6e 22 2c 22 | 21 74 65 73 74 61 70 70 |ation","|!testapp|
|00000240| 22 2c 31 30 32 34 29 0d | 00 b4 04 0d 00 be 04 0d |",1024).|........|
|00000250| 00 c8 1f f4 20 20 20 53 | 65 74 20 75 70 20 6f 75 |.... S|et up ou|
|00000260| 74 20 65 72 72 6f 72 20 | 74 72 61 70 20 3a 0d 00 |t error |trap :..|
|00000270| d2 04 0d 00 dc 37 ee 20 | 85 20 f2 77 69 6d 70 5f |.....7. |. .wimp_|
|00000280| 65 72 72 6f 72 28 31 2c | 9f 2c f6 24 2b 22 20 61 |error(1,|.,.$+" a|
|00000290| 74 20 6c 69 6e 65 20 22 | 2b c3 28 9e 29 29 3a f2 |t line "|+.(.)):.|
|000002a0| 77 69 6d 70 5f 71 75 69 | 74 0d 00 e6 04 0d 00 f0 |wimp_qui|t.......|
|000002b0| 04 0d 00 fa 36 f4 20 20 | 20 49 6e 69 74 69 61 6c |....6. | Initial|
|000002c0| 69 73 65 20 74 68 65 20 | 77 69 6e 64 6f 77 20 6c |ise the |window l|
|000002d0| 69 62 72 61 72 79 2c 20 | 66 6f 72 20 32 20 77 69 |ibrary, |for 2 wi|
|000002e0| 6e 64 6f 77 73 20 3a 0d | 01 04 04 0d 01 0e 04 0d |ndows :.|........|
|000002f0| 01 18 10 f2 77 69 6e 5f | 69 6e 69 74 28 32 29 0d |....win_|init(2).|
|00000300| 01 22 04 0d 01 2c 04 0d | 01 36 49 f4 20 20 20 4e |."...,..|.6I. N|
|00000310| 65 78 74 20 69 6e 69 74 | 69 61 6c 69 73 65 20 74 |ext init|ialise t|
|00000320| 68 65 20 74 65 6d 70 6c | 61 74 65 73 20 72 6f 75 |he templ|ates rou|
|00000330| 74 69 6e 65 73 2e 20 54 | 68 69 73 20 74 61 6b 65 |tines. T|his take|
|00000340| 73 20 6e 6f 20 70 61 72 | 61 6d 65 74 65 72 73 2e |s no par|ameters.|
|00000350| 0d 01 40 04 0d 01 4a 0e | f2 74 65 6d 70 5f 69 6e |..@...J.|.temp_in|
|00000360| 69 74 0d 01 54 04 0d 01 | 5e 04 0d 01 68 3a f4 20 |it..T...|^...h:. |
|00000370| 20 20 4e 6f 77 20 77 65 | 20 63 61 6e 20 72 65 61 | Now we| can rea|
|00000380| 64 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |d the ap|plicatio|
|00000390| 6e 27 73 20 74 65 6d 70 | 6c 61 74 65 73 20 66 69 |n's temp|lates fi|
|000003a0| 6c 65 20 3a 0d 01 72 04 | 0d 01 7c 32 f2 74 65 6d |le :..r.|..|2.tem|
|000003b0| 70 5f 72 65 61 64 66 69 | 6c 65 28 22 3c 54 65 73 |p_readfi|le("<Tes|
|000003c0| 74 41 70 70 24 44 69 72 | 3e 2e 54 65 6d 70 6c 61 |tApp$Dir|>.Templa|
|000003d0| 74 65 73 22 2c 31 30 32 | 34 29 0d 01 86 04 0d 01 |tes",102|4)......|
|000003e0| 90 04 0d 01 9a 4b f4 20 | 20 20 4e 65 78 74 20 63 |.....K. | Next c|
|000003f0| 72 65 61 74 65 20 74 77 | 6f 20 77 69 6e 64 6f 77 |reate tw|o window|
|00000400| 73 20 66 72 6f 6d 20 74 | 68 65 20 74 65 6d 70 6c |s from t|he templ|
|00000410| 61 74 65 73 2c 20 74 68 | 65 20 69 6e 66 6f 20 77 |ates, th|e info w|
|00000420| 69 6e 64 6f 77 20 61 6e | 64 20 74 68 65 0d 01 a4 |indow an|d the...|
|00000430| 47 f4 20 20 20 6d 61 69 | 6e 20 77 69 6e 64 6f 77 |G. mai|n window|
|00000440| 2e 20 42 65 6c 6f 77 20 | 73 68 6f 77 73 20 74 77 |. Below |shows tw|
|00000450| 6f 20 6d 65 74 68 6f 64 | 73 20 66 6f 72 20 63 72 |o method|s for cr|
|00000460| 65 61 74 69 6e 67 20 77 | 69 6e 64 6f 77 73 2c 20 |eating w|indows, |
|00000470| 62 6f 74 68 0d 01 ae 2c | f4 20 20 20 61 63 74 75 |both...,|. actu|
|00000480| 61 6c 6c 79 20 70 65 72 | 66 6f 72 6d 20 74 68 65 |ally per|form the|
|00000490| 20 73 61 6d 65 20 66 75 | 6e 63 74 69 6f 6e 20 3a | same fu|nction :|
|000004a0| 0d 01 b8 04 0d 01 c2 48 | 69 6e 66 6f 25 20 3d 20 |.......H|info% = |
|000004b0| a4 77 69 6e 5f 63 72 65 | 61 74 65 77 69 6e 28 22 |.win_cre|atewin("|
|000004c0| 49 6e 66 6f 22 29 20 20 | 20 3a 20 20 20 f4 20 20 |Info") | : . |
|000004d0| 20 54 68 65 20 73 69 6d | 70 6c 65 20 6d 65 74 68 | The sim|ple meth|
|000004e0| 6f 64 20 2d 20 4e 6f 74 | 65 20 46 4e 0d 01 cc 04 |od - Not|e FN....|
|000004f0| 0d 01 d6 3d 6d 61 69 6e | 25 20 3d 20 a4 74 65 6d |...=main|% = .tem|
|00000500| 70 5f 63 6f 70 79 28 22 | 6d 61 69 6e 22 29 20 20 |p_copy("|main") |
|00000510| 20 20 20 20 20 3a 20 20 | 20 f4 20 20 20 54 68 65 | : | . The|
|00000520| 20 6d 6f 72 65 20 63 6f | 6d 70 6c 65 78 0d 01 e0 | more co|mplex...|
|00000530| 4c f2 77 69 6e 5f 63 72 | 65 61 74 65 77 69 6e 28 |L.win_cr|eatewin(|
|00000540| 6d 61 69 6e 25 29 20 20 | 20 20 20 20 20 20 20 20 |main%) | |
|00000550| 3a 20 20 20 f4 20 20 20 | 6d 65 74 68 6f 64 20 75 |: . |method u|
|00000560| 73 69 6e 67 20 32 20 63 | 61 6c 6c 73 2e 20 2d 20 |sing 2 c|alls. - |
|00000570| 4e 6f 74 65 20 50 52 4f | 43 0d 01 ea 04 0d 01 f4 |Note PRO|C.......|
|00000580| 04 0d 01 fe 48 f4 20 20 | 20 4e 65 78 74 20 69 6e |....H. | Next in|
|00000590| 69 74 69 61 6c 69 73 65 | 20 74 68 65 20 6d 65 6e |itialise| the men|
|000005a0| 75 20 6c 69 62 72 61 72 | 79 2c 20 73 74 61 74 69 |u librar|y, stati|
|000005b0| 6e 67 20 74 68 61 74 20 | 77 65 20 69 6e 74 65 6e |ng that |we inten|
|000005c0| 64 20 74 6f 20 68 61 76 | 65 0d 02 08 44 f4 20 20 |d to hav|e...D. |
|000005d0| 20 32 20 6d 65 6e 75 73 | 20 28 77 65 20 63 61 6e | 2 menus| (we can|
|000005e0| 20 63 68 61 6e 67 65 20 | 74 68 69 73 20 76 61 6c | change |this val|
|000005f0| 75 65 20 6c 61 74 65 72 | 20 69 66 20 6d 6f 72 65 |ue later| if more|
|00000600| 20 61 72 65 20 6e 65 65 | 64 65 64 29 2e 0d 02 12 | are nee|ded)....|
|00000610| 04 0d 02 1c 11 f2 6d 65 | 6e 75 5f 69 6e 69 74 28 |......me|nu_init(|
|00000620| 32 29 0d 02 26 04 0d 02 | 30 04 0d 02 3a 4d f4 20 |2)..&...|0...:M. |
|00000630| 20 20 43 72 65 61 74 65 | 20 74 68 65 20 66 69 72 | Create| the fir|
|00000640| 73 74 20 28 6e 75 6d 62 | 65 72 20 30 29 20 6d 65 |st (numb|er 0) me|
|00000650| 6e 75 2c 20 67 69 76 69 | 6e 67 20 69 74 20 61 20 |nu, givi|ng it a |
|00000660| 74 69 74 6c 65 20 6f 66 | 20 22 54 65 73 74 20 41 |title of| "Test A|
|00000670| 70 70 22 20 61 6e 64 0d | 02 44 1d f4 20 20 20 67 |pp" and.|.D.. g|
|00000680| 69 76 69 6e 67 20 69 74 | 20 33 20 65 6e 74 72 69 |iving it| 3 entri|
|00000690| 65 73 20 3a 0d 02 4e 04 | 0d 02 58 20 f2 6d 65 6e |es :..N.|..X .men|
|000006a0| 75 5f 68 65 61 64 65 72 | 28 22 54 65 73 74 20 41 |u_header|("Test A|
|000006b0| 70 70 22 2c 30 2c 33 29 | 0d 02 62 04 0d 02 6c 04 |pp",0,3)|..b...l.|
|000006c0| 0d 02 76 49 f4 20 20 20 | 4e 6f 77 20 63 72 65 61 |..vI. |Now crea|
|000006d0| 74 65 20 74 68 65 20 33 | 20 65 6e 74 72 69 65 73 |te the 3| entries|
|000006e0| 2c 20 6f 6e 65 20 62 65 | 69 6e 67 20 22 49 6e 66 |, one be|ing "Inf|
|000006f0| 6f 22 2c 20 74 68 65 20 | 73 65 63 6f 6e 64 20 22 |o", the |second "|
|00000700| 53 75 62 20 4d 65 6e 75 | 22 0d 02 80 1d f4 20 20 |Sub Menu|"..... |
|00000710| 20 61 6e 64 20 74 68 65 | 20 74 68 69 72 64 20 22 | and the| third "|
|00000720| 51 75 69 74 22 2e 0d 02 | 8a 04 0d 02 94 1f f2 6d |Quit"...|.......m|
|00000730| 65 6e 75 5f 61 64 64 69 | 74 65 6d 28 30 2c 30 2c |enu_addi|tem(0,0,|
|00000740| 22 49 6e 66 6f 22 2c 30 | 29 0d 02 9e 23 f2 6d 65 |"Info",0|)...#.me|
|00000750| 6e 75 5f 61 64 64 69 74 | 65 6d 28 30 2c 31 2c 22 |nu_addit|em(0,1,"|
|00000760| 53 75 62 20 4d 65 6e 75 | 22 2c 30 29 0d 02 a8 1f |Sub Menu|",0)....|
|00000770| f2 6d 65 6e 75 5f 61 64 | 64 69 74 65 6d 28 30 2c |.menu_ad|ditem(0,|
|00000780| 32 2c 22 51 75 69 74 22 | 2c 30 29 0d 02 b2 04 0d |2,"Quit"|,0).....|
|00000790| 02 bc 04 0d 02 c6 3e f4 | 20 20 20 48 65 61 64 65 |......>.| Heade|
|000007a0| 72 20 66 6f 72 20 74 68 | 65 20 73 65 63 6f 6e 64 |r for th|e second|
|000007b0| 20 6d 65 6e 75 20 28 6e | 75 6d 62 65 72 20 31 29 | menu (n|umber 1)|
|000007c0| 20 77 69 74 68 20 32 20 | 65 6e 74 72 69 65 73 20 | with 2 |entries |
|000007d0| 3a 0d 02 d0 04 0d 02 da | 1e f2 6d 65 6e 75 5f 68 |:.......|..menu_h|
|000007e0| 65 61 64 65 72 28 22 53 | 65 63 6f 6e 64 22 2c 31 |eader("S|econd",1|
|000007f0| 2c 32 29 0d 02 e4 04 0d | 02 ee 04 0d 02 f8 49 f4 |,2).....|......I.|
|00000800| 20 20 20 4e 6f 77 20 74 | 68 65 20 69 74 65 6d 73 | Now t|he items|
|00000810| 2c 20 74 68 65 20 66 69 | 72 73 74 20 22 53 65 6c |, the fi|rst "Sel|
|00000820| 65 63 74 22 20 77 68 69 | 63 68 20 69 73 20 74 69 |ect" whi|ch is ti|
|00000830| 63 6b 65 64 20 61 6e 64 | 20 75 6e 64 65 72 6c 69 |cked and| underli|
|00000840| 6e 65 64 2c 0d 03 02 46 | f4 20 20 20 74 68 65 20 |ned,...F|. the |
|00000850| 73 65 63 6f 6e 64 20 69 | 73 20 61 20 77 72 69 74 |second i|s a writ|
|00000860| 61 62 6c 65 20 65 6e 74 | 72 79 20 70 6f 69 6e 74 |able ent|ry point|
|00000870| 69 6e 67 20 74 6f 20 61 | 20 62 75 66 66 65 72 20 |ing to a| buffer |
|00000880| 77 68 69 63 68 20 61 6c | 73 6f 0d 03 0c 1d f4 20 |which al|so..... |
|00000890| 20 20 6e 65 65 64 73 20 | 74 6f 20 62 65 20 64 65 | needs |to be de|
|000008a0| 66 69 6e 65 64 20 3a 0d | 03 16 04 0d 03 20 41 f2 |fined :.|..... A.|
|000008b0| 6d 65 6e 75 5f 61 64 64 | 69 74 65 6d 28 31 2c 30 |menu_add|item(1,0|
|000008c0| 2c 22 53 65 6c 65 63 74 | 22 2c 6d 65 6e 75 5f 74 |,"Select|",menu_t|
|000008d0| 69 63 6b 20 2b 20 6d 65 | 6e 75 5f 64 6f 74 74 65 |ick + me|nu_dotte|
|000008e0| 64 29 3a 74 69 63 6b 65 | 64 25 3d b9 0d 03 2a 04 |d):ticke|d%=...*.|
|000008f0| 0d 03 34 31 62 75 66 66 | 65 72 25 3d a4 6d 61 6c |..41buff|er%=.mal|
|00000900| 6c 6f 63 28 32 35 36 29 | 20 20 20 20 3a 20 20 20 |loc(256)| : |
|00000910| f4 20 32 35 36 20 62 79 | 74 65 20 62 75 66 66 65 |. 256 by|te buffe|
|00000920| 72 0d 03 3e 2d f2 6d 65 | 6e 75 5f 61 64 64 77 72 |r..>-.me|nu_addwr|
|00000930| 69 74 61 62 6c 65 28 31 | 2c 31 2c 31 30 2c 30 2c |itable(1|,1,10,0,|
|00000940| 62 75 66 66 65 72 25 2c | 30 2c 32 35 36 29 0d 03 |buffer%,|0,256)..|
|00000950| 48 04 0d 03 52 04 0d 03 | 5c 4c f4 20 20 20 4e 6f |H...R...|\L. No|
|00000960| 77 20 61 6c 6c 20 77 65 | 20 6e 65 65 64 20 74 6f |w all we| need to|
|00000970| 20 64 6f 20 69 73 20 6a | 6f 69 6e 20 74 68 69 6e | do is j|oin thin|
|00000980| 67 73 20 74 6f 20 74 68 | 65 20 66 69 72 73 74 20 |gs to th|e first |
|00000990| 6d 65 6e 75 2c 20 69 65 | 2e 20 74 68 65 20 69 6e |menu, ie|. the in|
|000009a0| 66 6f 0d 03 66 24 f4 20 | 20 20 77 69 6e 64 6f 77 |fo..f$. | window|
|000009b0| 20 61 6e 64 20 74 68 65 | 20 73 65 63 6f 6e 64 20 | and the| second |
|000009c0| 6d 65 6e 75 20 3a 0d 03 | 70 04 0d 03 7a 1e f2 6d |menu :..|p...z..m|
|000009d0| 65 6e 75 5f 73 75 62 77 | 69 6e 64 6f 77 28 30 2c |enu_subw|indow(0,|
|000009e0| 30 2c 69 6e 66 6f 25 29 | 0d 03 84 18 f2 6d 65 6e |0,info%)|.....men|
|000009f0| 75 5f 73 75 62 6d 65 6e | 75 28 30 2c 31 2c 31 29 |u_submen|u(0,1,1)|
|00000a00| 0d 03 8e 04 0d 03 98 04 | 0d 03 a2 2b f4 20 20 20 |........|...+. |
|00000a10| 4e 6f 77 20 6a 75 73 74 | 20 70 65 72 66 6f 72 6d |Now just| perform|
|00000a20| 20 61 20 77 69 6d 70 20 | 70 6f 6c 6c 20 6c 6f 6f | a wimp |poll loo|
|00000a30| 70 20 3a 0d 03 ac 04 0d | 03 b6 05 f5 0d 03 c0 15 |p :.....|........|
|00000a40| 20 20 f2 77 69 6d 70 5f | 70 6f 6c 6c 28 30 2c 30 | .wimp_|poll(0,0|
|00000a50| 29 0d 03 ca 07 fd 20 a3 | 0d 03 d4 04 0d 03 de 04 |)..... .|........|
|00000a60| 0d 03 e8 4d f4 20 20 20 | 59 6f 75 20 6e 65 65 64 |...M. |You need|
|00000a70| 20 74 6f 20 73 75 70 70 | 6c 79 20 73 6f 6d 65 20 | to supp|ly some |
|00000a80| 72 6f 75 74 69 6e 65 73 | 2c 20 74 68 65 20 6c 69 |routines|, the li|
|00000a90| 62 72 61 72 79 20 63 61 | 6e 27 74 20 73 75 70 70 |brary ca|n't supp|
|00000aa0| 6c 79 20 65 76 65 72 79 | 74 68 69 6e 67 0d 03 f2 |ly every|thing...|
|00000ab0| 04 0d 03 fc 04 0d 04 06 | 4a f4 20 20 20 46 6f 72 |........|J. For|
|00000ac0| 20 74 68 65 20 61 76 6f | 76 65 20 73 65 74 75 70 | the avo|ve setup|
|00000ad0| 2c 20 79 6f 75 20 4e 45 | 45 44 20 74 6f 20 73 75 |, you NE|ED to su|
|00000ae0| 70 70 6c 79 20 74 77 6f | 20 72 6f 75 74 69 6e 65 |pply two| routine|
|00000af0| 73 2c 20 74 68 65 20 66 | 69 72 73 74 20 69 73 0d |s, the f|irst is.|
|00000b00| 04 10 4a f4 20 20 20 63 | 61 6c 6c 65 64 20 77 68 |..J. c|alled wh|
|00000b10| 65 6e 20 27 6d 65 6e 75 | 27 20 69 73 20 70 72 65 |en 'menu|' is pre|
|00000b20| 73 73 65 64 20 6f 76 65 | 72 20 74 68 65 20 69 63 |ssed ove|r the ic|
|00000b30| 6f 6e 62 61 72 20 69 63 | 6f 6e 2e 20 54 68 69 73 |onbar ic|on. This|
|00000b40| 20 66 75 6e 63 74 69 6f | 6e 0d 04 1a 4a f4 20 20 | functio|n...J. |
|00000b50| 20 28 77 68 69 63 68 20 | 6d 75 73 74 20 62 65 20 | (which |must be |
|00000b60| 63 61 6c 6c 65 64 20 46 | 4e 77 69 6d 70 5f 6d 61 |called F|Nwimp_ma|
|00000b70| 69 6e 6d 65 6e 75 29 20 | 73 68 6f 75 6c 64 20 74 |inmenu) |should t|
|00000b80| 68 65 6e 20 63 72 65 61 | 74 65 20 74 68 65 20 6d |hen crea|te the m|
|00000b90| 65 6e 75 0d 04 24 4d f4 | 20 20 20 28 69 66 20 69 |enu..$M.| (if i|
|00000ba0| 74 20 69 73 20 6e 6f 74 | 20 61 6c 72 65 61 64 79 |t is not| already|
|00000bb0| 20 63 72 65 61 74 65 64 | 29 20 61 6e 64 20 72 65 | created|) and re|
|00000bc0| 74 75 72 6e 20 74 68 65 | 20 6d 65 6e 75 20 6e 75 |turn the| menu nu|
|00000bd0| 6d 62 65 72 20 6f 66 20 | 74 68 65 20 6d 61 69 6e |mber of |the main|
|00000be0| 0d 04 2e 4a f4 20 20 20 | 6d 65 6e 75 2e 20 49 6e |...J. |menu. In|
|00000bf0| 20 6f 75 72 20 63 61 73 | 65 20 77 65 20 68 61 76 | our cas|e we hav|
|00000c00| 65 20 61 6c 72 65 61 64 | 79 20 63 72 65 61 74 65 |e alread|y create|
|00000c10| 64 20 74 68 65 20 6d 65 | 6e 75 73 2c 20 61 6e 64 |d the me|nus, and|
|00000c20| 20 6a 75 73 74 20 6e 65 | 65 64 0d 04 38 48 f4 20 | just ne|ed..8H. |
|00000c30| 20 20 74 6f 20 72 65 74 | 75 72 6e 20 30 20 28 74 | to ret|urn 0 (t|
|00000c40| 68 65 20 6d 61 69 6e 20 | 6d 65 6e 75 20 6e 75 6d |he main |menu num|
|00000c50| 62 65 72 29 2e 20 54 68 | 69 73 20 66 75 6e 63 74 |ber). Th|is funct|
|00000c60| 69 6f 6e 20 69 73 20 65 | 78 70 65 63 74 65 64 20 |ion is e|xpected |
|00000c70| 74 6f 0d 04 42 25 f4 20 | 20 20 62 65 20 74 68 65 |to..B%. | be the|
|00000c80| 72 65 20 62 79 20 74 68 | 65 20 57 49 4d 50 20 6c |re by th|e WIMP l|
|00000c90| 69 62 72 61 72 79 2e 0d | 04 4c 04 0d 04 56 13 dd |ibrary..|.L...V..|
|00000ca0| a4 77 69 6d 70 5f 6d 61 | 69 6e 6d 65 6e 75 0d 04 |.wimp_ma|inmenu..|
|00000cb0| 60 06 3d 30 0d 04 6a 04 | 0d 04 74 04 0d 04 7e 4c |`.=0..j.|..t...~L|
|00000cc0| f4 20 20 20 54 68 65 20 | 73 65 63 6f 6e 64 20 72 |. The |second r|
|00000cd0| 6f 75 74 69 6e 65 20 77 | 65 20 6e 65 65 64 20 74 |outine w|e need t|
|00000ce0| 6f 20 73 75 70 70 6c 79 | 20 69 73 20 74 68 65 20 |o supply| is the |
|00000cf0| 6d 65 6e 75 20 73 65 6c | 65 63 74 69 6f 6e 20 70 |menu sel|ection p|
|00000d00| 72 6f 63 65 64 75 72 65 | 0d 04 88 4a f4 20 20 20 |rocedure|...J. |
|00000d10| 28 77 68 69 63 68 20 6d | 75 73 74 20 62 65 20 63 |(which m|ust be c|
|00000d20| 61 6c 6c 65 64 20 50 52 | 4f 43 65 76 65 6e 74 5f |alled PR|OCevent_|
|00000d30| 6d 65 6e 75 73 65 6c 65 | 63 74 69 6f 6e 29 20 77 |menusele|ction) w|
|00000d40| 68 69 63 68 20 69 73 20 | 70 61 73 73 65 64 20 74 |hich is |passed t|
|00000d50| 68 65 0d 04 92 4c f4 20 | 20 20 77 69 6d 70 20 70 |he...L. | wimp p|
|00000d60| 6f 6c 6c 20 62 6c 6f 63 | 6b 20 75 70 6f 6e 20 61 |oll bloc|k upon a|
|00000d70| 20 6d 65 6e 75 20 73 65 | 6c 65 63 74 69 6f 6e 2e | menu se|lection.|
|00000d80| 20 54 68 65 20 76 61 72 | 69 61 62 6c 65 20 27 5f | The var|iable '_|
|00000d90| 77 69 6d 70 5f 6f 6c 64 | 6d 65 6e 75 25 27 0d 04 |wimp_old|menu%'..|
|00000da0| 9c 4d f4 20 20 20 63 6f | 6e 74 61 69 6e 73 20 74 |.M. co|ntains t|
|00000db0| 68 65 20 6d 65 6e 75 20 | 6e 75 6d 62 65 72 20 77 |he menu |number w|
|00000dc0| 68 69 63 68 20 77 61 73 | 20 6c 61 73 74 20 70 6f |hich was| last po|
|00000dd0| 70 65 64 20 75 70 20 62 | 79 20 74 68 65 20 70 72 |ped up b|y the pr|
|00000de0| 6f 67 72 61 6d 2c 20 6a | 75 73 74 0d 04 a6 4b f4 |ogram, j|ust...K.|
|00000df0| 20 20 20 69 6e 20 63 61 | 73 65 20 79 6f 75 20 6e | in ca|se you n|
|00000e00| 65 65 64 20 74 6f 20 6b | 6e 6f 77 20 74 68 69 73 |eed to k|now this|
|00000e10| 20 28 69 65 2e 20 69 66 | 20 79 6f 75 20 68 61 76 | (ie. if| you hav|
|00000e20| 65 20 6d 6f 72 65 20 74 | 68 61 6e 20 6f 6e 65 20 |e more t|han one |
|00000e30| 73 65 74 20 6f 66 0d 04 | b0 4d f4 20 20 20 6d 65 |set of..|.M. me|
|00000e40| 6e 75 73 29 2e 20 41 67 | 61 69 6e 20 74 68 69 73 |nus). Ag|ain this|
|00000e50| 20 70 72 6f 63 65 64 75 | 72 65 20 69 73 20 65 78 | procedu|re is ex|
|00000e60| 70 65 63 74 65 64 20 74 | 6f 20 62 65 20 74 68 65 |pected t|o be the|
|00000e70| 72 65 20 69 6e 20 65 76 | 65 72 79 20 70 72 6f 67 |re in ev|ery prog|
|00000e80| 72 61 6d 0d 04 ba 24 f4 | 20 20 20 77 68 69 63 68 |ram...$.| which|
|00000e90| 20 75 73 65 73 20 74 68 | 65 20 57 49 4d 50 20 6c | uses th|e WIMP l|
|00000ea0| 69 62 72 61 72 79 2e 0d | 04 c4 04 0d 04 ce 1d dd |ibrary..|........|
|00000eb0| f2 65 76 65 6e 74 5f 6d | 65 6e 75 73 65 6c 65 63 |.event_m|enuselec|
|00000ec0| 74 69 6f 6e 28 42 25 29 | 0d 04 d8 04 0d 04 e2 3a |tion(B%)|.......:|
|00000ed0| f4 20 20 20 46 69 6e 64 | 20 6f 75 74 20 77 68 61 |. Find| out wha|
|00000ee0| 74 20 65 6e 74 72 79 20 | 69 6e 20 74 68 65 20 66 |t entry |in the f|
|00000ef0| 69 72 73 74 20 6d 65 6e | 75 20 77 61 73 20 73 65 |irst men|u was se|
|00000f00| 6c 65 63 74 65 64 0d 04 | ec 04 0d 04 f6 0c c8 8e |lected..|........|
|00000f10| 20 21 42 25 20 ca 0d 05 | 00 3f 20 20 20 c9 20 31 | !B% ...|.? . 1|
|00000f20| 20 3a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | : | |
|00000f30| 20 20 20 20 20 20 20 20 | 20 f4 20 20 20 53 75 62 | | . Sub|
|00000f40| 20 6d 65 6e 75 2c 20 66 | 6f 6c 6c 6f 77 20 69 74 | menu, f|ollow it|
|00000f50| 20 64 6f 77 6e 0d 05 0a | 13 20 20 20 20 20 20 c8 | down...|. .|
|00000f60| 8e 20 42 25 21 34 20 ca | 0d 05 14 44 20 20 20 20 |. B%!4 .|...D |
|00000f70| 20 20 20 20 20 c9 20 30 | 20 3a 20 20 20 20 20 20 | . 0| : |
|00000f80| 20 20 20 20 20 20 20 20 | 20 20 20 f4 20 20 20 4f | | . O|
|00000f90| 75 72 20 27 53 65 6c 65 | 63 74 27 20 65 6e 74 72 |ur 'Sele|ct' entr|
|00000fa0| 79 2c 20 74 6f 67 67 6c | 65 20 69 74 0d 05 1e 23 |y, toggl|e it...#|
|00000fb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 74 69 63 | | tic|
|00000fc0| 6b 65 64 25 3d ac 28 74 | 69 63 6b 65 64 25 29 0d |ked%=.(t|icked%).|
|00000fd0| 05 28 4e 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.(N | |
|00000fe0| f2 6d 65 6e 75 5f 61 64 | 64 69 74 65 6d 28 31 2c |.menu_ad|ditem(1,|
|00000ff0| 30 2c 22 53 65 6c 65 63 | 74 22 2c 28 74 69 63 6b |0,"Selec|t",(tick|
|00001000| 65 64 25 20 80 20 6d 65 | 6e 75 5f 74 69 63 6b 29 |ed% . me|nu_tick)|
|00001010| 2b 6d 65 6e 75 5f 64 6f | 74 74 65 64 29 0d 05 32 |+menu_do|tted)..2|
|00001020| 04 0d 05 3c 4c 20 20 20 | 20 20 20 20 20 20 c9 20 |...<L | . |
|00001030| 31 20 3a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |1 : | |
|00001040| 20 20 20 20 f4 20 20 20 | 57 72 69 74 61 62 6c 65 | . |Writable|
|00001050| 20 65 6e 74 72 79 2c 20 | 73 65 74 20 6d 61 69 6e | entry, |set main|
|00001060| 20 77 69 6e 64 6f 77 20 | 74 69 74 6c 65 0d 05 46 | window |title..F|
|00001070| 3c 20 20 20 20 20 20 20 | 20 20 20 20 20 20 f2 77 |< | .w|
|00001080| 69 6e 5f 73 65 74 74 69 | 74 6c 65 28 6d 61 69 6e |in_setti|tle(main|
|00001090| 25 2c a4 6f 73 5f 67 65 | 74 73 74 72 69 6e 67 28 |%,.os_ge|tstring(|
|000010a0| 62 75 66 66 65 72 25 29 | 29 0d 05 50 0b 20 20 20 |buffer%)|)..P. |
|000010b0| 20 20 20 cb 0d 05 5a 04 | 0d 05 64 16 20 20 c9 20 | ...Z.|..d. . |
|000010c0| 32 20 3a 20 f2 77 69 6d | 70 5f 71 75 69 74 0d 05 |2 : .wim|p_quit..|
|000010d0| 6e 05 cb 0d 05 78 05 e1 | 0d 05 82 04 0d 05 8c 04 |n....x..|........|
|000010e0| 0d 05 96 4c f4 20 20 20 | 57 68 65 6e 20 27 73 65 |...L. |When 'se|
|000010f0| 6c 65 63 74 27 20 69 73 | 20 70 72 65 73 73 65 64 |lect' is| pressed|
|00001100| 20 6f 76 65 72 20 74 68 | 65 20 69 63 6f 6e 62 61 | over th|e iconba|
|00001110| 72 20 69 63 6f 6e 2c 20 | 77 65 20 77 61 6e 74 20 |r icon, |we want |
|00001120| 74 6f 20 70 6f 70 75 70 | 20 74 68 65 0d 05 a0 41 |to popup| the...A|
|00001130| f4 20 20 20 6d 61 69 6e | 20 77 69 6e 64 6f 77 2e |. main| window.|
|00001140| 20 54 6f 20 64 6f 20 74 | 68 69 73 20 77 65 20 6a | To do t|his we j|
|00001150| 75 73 74 20 64 65 66 69 | 6e 65 20 61 20 70 72 6f |ust defi|ne a pro|
|00001160| 63 65 64 75 72 65 20 63 | 61 6c 6c 65 64 0d 05 aa |cedure c|alled...|
|00001170| 49 f4 20 20 20 50 52 4f | 43 65 76 65 6e 74 5f 69 |I. PRO|Cevent_i|
|00001180| 63 6f 6e 62 61 72 73 65 | 6c 65 63 74 2e 20 54 68 |conbarse|lect. Th|
|00001190| 69 73 20 70 72 6f 63 65 | 64 75 72 65 20 64 6f 65 |is proce|dure doe|
|000011a0| 73 20 4e 4f 54 20 6e 65 | 65 64 20 74 6f 20 65 78 |s NOT ne|ed to ex|
|000011b0| 69 73 74 20 69 6e 0d 05 | b4 4c f4 20 20 20 65 76 |ist in..|.L. ev|
|000011c0| 65 72 79 20 70 72 6f 67 | 72 61 6d 2c 20 75 6e 6c |ery prog|ram, unl|
|000011d0| 69 6b 65 20 74 68 65 20 | 74 77 6f 20 61 62 6f 76 |ike the |two abov|
|000011e0| 65 2e 20 54 68 69 73 20 | 70 72 6f 63 65 64 75 72 |e. This |procedur|
|000011f0| 65 2c 20 77 68 69 63 68 | 20 74 61 6b 65 73 20 74 |e, which| takes t|
|00001200| 68 65 0d 05 be 48 f4 20 | 20 20 77 69 6d 70 20 70 |he...H. | wimp p|
|00001210| 6f 6c 6c 20 62 6c 6f 63 | 6b 20 61 73 20 61 20 70 |oll bloc|k as a p|
|00001220| 61 72 61 6d 65 74 65 72 | 2c 20 77 69 6c 6c 20 73 |arameter|, will s|
|00001230| 69 6d 70 6c 79 20 6f 70 | 65 6e 20 6f 75 72 20 6d |imply op|en our m|
|00001240| 61 69 6e 20 77 69 6e 64 | 6f 77 0d 05 c8 24 f4 20 |ain wind|ow...$. |
|00001250| 20 20 69 6e 20 74 68 65 | 20 63 65 6e 74 72 65 20 | in the| centre |
|00001260| 6f 66 20 74 68 65 20 73 | 63 72 65 65 6e 2e 0d 05 |of the s|creen...|
|00001270| d2 04 0d 05 dc 1d dd f2 | 65 76 65 6e 74 5f 69 63 |........|event_ic|
|00001280| 6f 6e 62 61 72 73 65 6c | 65 63 74 28 42 25 29 0d |onbarsel|ect(B%).|
|00001290| 05 e6 11 ea 20 58 25 2c | 59 25 2c 78 25 2c 79 25 |.... X%,|Y%,x%,y%|
|000012a0| 0d 05 f0 47 f2 77 69 6e | 5f 67 65 74 73 69 7a 65 |...G.win|_getsize|
|000012b0| 28 6d 61 69 6e 25 2c 78 | 25 2c 79 25 29 20 20 20 |(main%,x|%,y%) |
|000012c0| 20 20 20 20 20 20 20 3a | 20 20 20 f4 20 47 65 74 | :| . Get|
|000012d0| 20 77 69 6e 64 6f 77 20 | 73 69 7a 65 20 69 6e 74 | window |size int|
|000012e0| 6f 20 78 25 2c 79 25 0d | 05 fa 47 f2 6f 73 5f 73 |o x%,y%.|..G.os_s|
|000012f0| 63 72 65 65 6e 73 69 7a | 65 28 58 25 2c 59 25 29 |creensiz|e(X%,Y%)|
|00001300| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 3a 20 | | : |
|00001310| 20 20 f4 20 47 65 74 20 | 73 63 72 65 65 6e 20 73 | . Get |screen s|
|00001320| 69 7a 65 20 69 6e 74 6f | 20 58 25 2c 59 25 0d 06 |ize into| X%,Y%..|
|00001330| 04 2d f2 77 69 6e 5f 6d | 6f 76 65 77 69 6e 28 6d |.-.win_m|ovewin(m|
|00001340| 61 69 6e 25 2c 28 58 25 | 2d 78 25 29 81 20 32 2c |ain%,(X%|-x%). 2,|
|00001350| 28 59 25 2d 79 25 29 81 | 20 32 29 0d 06 0e 05 e1 |(Y%-y%).| 2).....|
|00001360| 0d 06 18 04 0d 06 22 45 | f4 20 20 20 4e 4f 54 45 |......"E|. NOTE|
|00001370| 20 3a 20 50 52 4f 43 77 | 69 6e 5f 6d 6f 76 65 77 | : PROCw|in_movew|
|00001380| 69 6e 20 63 61 6e 20 62 | 65 20 75 73 65 64 20 69 |in can b|e used i|
|00001390| 6e 73 74 65 61 64 20 6f | 66 20 50 52 4f 43 77 69 |nstead o|f PROCwi|
|000013a0| 6e 5f 6f 70 65 6e 77 69 | 6e 0d 06 2c 04 0d 06 36 |n_openwi|n..,...6|
|000013b0| 04 0d 06 40 49 f4 20 20 | 20 57 68 65 6e 20 27 61 |...@I. | When 'a|
|000013c0| 64 6a 75 73 74 27 20 69 | 73 20 70 72 65 73 73 65 |djust' i|s presse|
|000013d0| 64 20 6f 76 65 72 20 74 | 68 65 20 69 63 6f 6e 62 |d over t|he iconb|
|000013e0| 61 72 20 69 63 6f 6e 20 | 77 65 20 77 69 6c 6c 20 |ar icon |we will |
|000013f0| 63 68 61 6e 67 65 20 74 | 68 65 0d 06 4a 4b f4 20 |change t|he..JK. |
|00001400| 20 20 72 61 64 69 6f 20 | 73 65 6c 65 63 74 69 6f | radio |selectio|
|00001410| 6e 20 69 6e 20 74 68 65 | 20 6d 61 69 6e 20 77 69 |n in the| main wi|
|00001420| 6e 64 6f 77 2e 20 54 68 | 69 73 20 77 69 6c 6c 20 |ndow. Th|is will |
|00001430| 69 6e 76 6f 6c 76 65 20 | 66 69 6e 64 69 6e 67 20 |involve |finding |
|00001440| 77 68 69 63 68 0d 06 54 | 49 f4 20 20 20 69 63 6f |which..T|I. ico|
|00001450| 6e 20 69 73 20 63 75 72 | 72 65 6e 74 6c 79 20 73 |n is cur|rently s|
|00001460| 65 6c 65 63 74 65 64 2c | 20 64 65 73 65 6c 65 63 |elected,| deselec|
|00001470| 74 69 6e 67 20 69 74 20 | 28 77 65 20 73 68 61 6c |ting it |(we shal|
|00001480| 6c 20 64 65 73 65 6c 65 | 63 74 20 74 68 65 0d 06 |l desele|ct the..|
|00001490| 5e 48 f4 20 20 20 77 68 | 6f 6c 65 20 67 72 6f 75 |^H. wh|ole grou|
|000014a0| 70 20 69 6e 20 74 68 69 | 73 20 65 78 61 6d 70 6c |p in thi|s exampl|
|000014b0| 65 29 20 61 6e 64 20 73 | 65 6c 65 63 74 20 74 68 |e) and s|elect th|
|000014c0| 65 20 6e 65 77 20 6f 6e | 65 2e 20 52 61 64 69 6f |e new on|e. Radio|
|000014d0| 20 69 63 6f 6e 73 0d 06 | 68 40 f4 20 20 20 69 6e | icons..|h@. in|
|000014e0| 20 74 68 65 20 6d 61 69 | 6e 20 77 69 6e 64 6f 77 | the mai|n window|
|000014f0| 20 61 72 65 20 69 63 6f | 6e 73 20 32 20 74 6f 20 | are ico|ns 2 to |
|00001500| 36 20 61 6e 64 20 68 61 | 76 65 20 61 6e 20 45 53 |6 and ha|ve an ES|
|00001510| 47 20 6f 66 20 31 0d 06 | 72 04 0d 06 7c 1d dd f2 |G of 1..|r...|...|
|00001520| 65 76 65 6e 74 5f 69 63 | 6f 6e 62 61 72 61 64 6a |event_ic|onbaradj|
|00001530| 75 73 74 28 42 25 29 0d | 06 86 0b ea 20 41 25 2c |ust(B%).|.... A%,|
|00001540| 53 25 0d 06 90 13 53 25 | 3d 31 3a e3 20 41 25 3d |S%....S%|=1:. A%=|
|00001550| 32 20 b8 20 36 0d 06 9a | 29 20 20 e7 20 a4 69 63 |2 . 6...|) . .ic|
|00001560| 6f 6e 5f 67 65 74 73 65 | 6c 65 63 74 28 6d 61 69 |on_getse|lect(mai|
|00001570| 6e 25 2c 41 25 29 20 8c | 20 53 25 3d 41 25 0d 06 |n%,A%) .| S%=A%..|
|00001580| a4 05 ed 0d 06 ae 17 53 | 25 2b 3d 31 3a e7 20 53 |.......S|%+=1:. S|
|00001590| 25 3d 37 20 8c 20 53 25 | 3d 32 0d 06 b8 3f f2 69 |%=7 . S%|=2...?.i|
|000015a0| 63 6f 6e 5f 67 72 6f 75 | 70 64 65 73 65 6c 65 63 |con_grou|pdeselec|
|000015b0| 74 28 6d 61 69 6e 25 2c | 31 29 20 20 20 3a 20 f4 |t(main%,|1) : .|
|000015c0| 20 44 65 73 65 6c 65 63 | 74 20 61 6c 6c 20 45 53 | Deselec|t all ES|
|000015d0| 47 20 31 20 69 63 6f 6e | 73 0d 06 c2 1a f2 69 63 |G 1 icon|s.....ic|
|000015e0| 6f 6e 5f 73 65 6c 65 63 | 74 28 6d 61 69 6e 25 2c |on_selec|t(main%,|
|000015f0| 53 25 29 0d 06 cc 05 e1 | 0d 06 d6 04 0d 06 e0 04 |S%).....|........|
|00001600| 0d 06 ea 4f f4 20 20 20 | 46 69 6e 61 6c 6c 79 20 |...O. |Finally |
|00001610| 77 68 65 6e 20 74 68 65 | 20 77 72 69 74 61 62 6c |when the| writabl|
|00001620| 65 20 69 63 6f 6e 20 28 | 30 29 20 69 6e 20 74 68 |e icon (|0) in th|
|00001630| 65 20 6d 61 69 6e 20 77 | 69 6e 64 6f 77 20 68 61 |e main w|indow ha|
|00001640| 73 20 74 65 78 74 20 74 | 79 70 65 64 20 69 6e 0d |s text t|yped in.|
|00001650| 06 f4 51 f4 20 20 20 69 | 74 20 61 6e 64 20 52 45 |..Q. i|t and RE|
|00001660| 54 55 52 4e 20 69 73 20 | 70 72 65 73 73 65 64 2c |TURN is |pressed,|
|00001670| 20 63 6f 70 79 20 74 68 | 65 20 74 65 78 74 20 66 | copy th|e text f|
|00001680| 72 6f 6d 20 74 68 61 74 | 20 69 63 6f 6e 20 74 6f |rom that| icon to|
|00001690| 20 74 68 65 20 6f 6e 65 | 20 6e 65 78 74 20 74 6f | the one| next to|
|000016a0| 0d 06 fe 3d f4 20 20 20 | 69 74 20 28 31 29 2e 20 |...=. |it (1). |
|000016b0| 54 6f 20 64 6f 20 74 68 | 69 73 20 77 65 20 6e 65 |To do th|is we ne|
|000016c0| 65 64 20 74 6f 20 74 72 | 61 70 20 6b 65 79 20 70 |ed to tr|ap key p|
|000016d0| 72 65 73 73 20 65 76 65 | 6e 74 73 20 3a 0d 07 08 |ress eve|nts :...|
|000016e0| 04 0d 07 12 04 0d 07 1c | 18 dd f2 65 76 65 6e 74 |........|...event|
|000016f0| 5f 6b 65 79 70 72 65 73 | 73 28 42 25 29 0d 07 26 |_keypres|s(B%)..&|
|00001700| 0b ea 20 57 25 2c 54 24 | 0d 07 30 04 0d 07 3a 4e |.. W%,T$|..0...:N|
|00001710| f4 20 20 20 46 69 72 73 | 74 20 77 65 20 6e 65 65 |. Firs|t we nee|
|00001720| 64 20 74 6f 20 67 65 74 | 20 74 68 65 20 27 77 69 |d to get| the 'wi|
|00001730| 6e 64 6f 77 27 20 66 6f | 72 20 74 68 65 20 6b 65 |ndow' fo|r the ke|
|00001740| 79 20 70 72 65 73 73 20 | 65 76 65 6e 74 2e 20 54 |y press |event. T|
|00001750| 68 69 73 20 69 73 20 6e | 6f 74 0d 07 44 47 f4 20 |his is n|ot..DG. |
|00001760| 20 20 74 68 65 20 77 69 | 6e 64 6f 77 20 68 61 6e | the wi|ndow han|
|00001770| 64 6c 65 20 28 69 65 2e | 20 21 42 25 29 2c 20 62 |dle (ie.| !B%), b|
|00001780| 75 74 20 74 68 65 20 42 | 6c 69 62 20 77 69 6e 64 |ut the B|lib wind|
|00001790| 6f 77 20 6c 69 62 72 61 | 72 79 20 77 69 6e 64 6f |ow libra|ry windo|
|000017a0| 77 0d 07 4e 13 f4 20 20 | 20 73 74 72 75 63 74 75 |w..N.. | structu|
|000017b0| 72 65 20 3a 0d 07 58 04 | 0d 07 62 18 57 25 3d a4 |re :..X.|..b.W%=.|
|000017c0| 77 69 6e 5f 66 69 6e 64 | 77 69 6e 28 21 42 25 29 |win_find|win(!B%)|
|000017d0| 0d 07 6c 04 0d 07 76 4b | f4 20 20 20 49 66 20 74 |..l...vK|. If t|
|000017e0| 68 69 73 20 69 73 20 6f | 75 72 20 6d 61 69 6e 20 |his is o|ur main |
|000017f0| 77 69 6e 64 6f 77 2c 20 | 61 6e 64 20 74 68 65 20 |window, |and the |
|00001800| 69 63 6f 6e 20 77 61 73 | 20 69 63 6f 6e 20 30 20 |icon was| icon 0 |
|00001810| 61 6e 64 20 74 68 65 20 | 6b 65 79 20 77 61 73 0d |and the |key was.|
|00001820| 07 80 4e f4 20 20 20 52 | 45 54 55 52 4e 20 28 31 |..N. R|ETURN (1|
|00001830| 33 29 20 74 68 65 6e 20 | 63 6f 70 79 20 74 68 65 |3) then |copy the|
|00001840| 20 69 63 6f 6e 20 74 65 | 78 74 2c 20 6f 74 68 65 | icon te|xt, othe|
|00001850| 72 77 69 73 65 20 70 61 | 73 73 20 74 68 65 20 6b |rwise pa|ss the k|
|00001860| 65 79 70 72 65 73 73 20 | 6f 6e 2e 2e 2e 0d 07 8a |eypress |on......|
|00001870| 04 0d 07 94 24 e7 20 57 | 25 3d 6d 61 69 6e 25 20 |....$. W|%=main% |
|00001880| 80 20 42 25 21 34 3d 30 | 20 80 20 42 25 21 32 34 |. B%!4=0| . B%!24|
|00001890| 3d 31 33 20 8c 0d 07 9e | 1f 20 20 54 24 3d a4 69 |=13 ....|. T$=.i|
|000018a0| 63 6f 6e 5f 67 65 74 74 | 65 78 74 28 6d 61 69 6e |con_gett|ext(main|
|000018b0| 25 2c 30 29 0d 07 a8 1f | 20 20 f2 69 63 6f 6e 5f |%,0)....| .icon_|
|000018c0| 73 65 74 74 65 78 74 28 | 6d 61 69 6e 25 2c 31 2c |settext(|main%,1,|
|000018d0| 54 24 29 0d 07 b2 05 cc | 0d 07 bc 20 20 20 c8 99 |T$).....|... ..|
|000018e0| 20 22 57 69 6d 70 5f 50 | 72 6f 63 65 73 73 4b 65 | "Wimp_P|rocessKe|
|000018f0| 79 22 2c 42 25 21 32 34 | 0d 07 c6 05 cd 0d 07 d0 |y",B%!24|........|
|00001900| 04 0d 07 da 05 e1 0d 07 | e4 04 0d 07 ee 04 0d ff |........|........|
+--------+-------------------------+-------------------------+--------+--------+