1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
|
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
<year>2000</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
The contents of this file are subject to the Erlang Public License,
Version 1.1, (the "License"); you may not use this file except in
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
</legalnotice>
<title>Built-In Objects</title>
<prepared></prepared>
<docno></docno>
<date></date>
<rev></rev>
<file>gs_chapter8.xml</file>
</header>
<section>
<title>Overview</title>
<p>This section describes the built-in objects of the graphics interface. The following objects exist:</p>
<taglist>
<tag><em>Window</em></tag>
<item>An ordinary window.</item>
<tag><em>Button</em></tag>
<item>A simple press button.</item>
<tag><em>Checkbutton</em></tag>
<item>A button with a check-mark indicator.</item>
<tag><em>Radiobutton</em></tag>
<item>A button with an indicator that has an only-one-selected-at-a-time property.</item>
<tag><em>Label</em></tag>
<item>Shows a text or bitmap.</item>
<tag><em>Frame</em></tag>
<item>A plain container object. It is used for logical and visual grouping of objects.</item>
<tag><em>Entry</em></tag>
<item>A one-line object for entering text.</item>
<tag><em>Listbox</em></tag>
<item>A list of text strings.</item>
<tag><em>Canvas</em></tag>
<item>A drawing area which contains light-weight objects such as rectangle, line, etc.</item>
<tag><em>Menu</em></tag>
<item>A collection of objects for constructing pull-down and pop-up menus.</item>
<tag><em>Grid</em></tag>
<item>An object for showing tables. A kind of multi-column listbox.</item>
<tag><em>Editor</em></tag>
<item>A multi-line text editor.</item>
<tag><em>Scale</em></tag>
<item>To select a value within a range.</item>
</taglist>
<p>Some objects can act as container objects. The following table describes these relationships:</p>
<table>
<row>
<cell align="left" valign="middle"><em>Objects</em></cell>
<cell align="left" valign="middle"><em>Valid Parents</em></cell>
</row>
<row>
<cell align="left" valign="middle">window</cell>
<cell align="left" valign="middle">window, gs</cell>
</row>
<row>
<cell align="left" valign="middle">buttons, canvas, editor, entry, frame, grid, label, listbox, menubar, scale</cell>
<cell align="left" valign="middle">frame, window</cell>
</row>
<row>
<cell align="left" valign="middle">arc, image, line, oval, polygon, rectangle, text</cell>
<cell align="left" valign="middle">canvas</cell>
</row>
<row>
<cell align="left" valign="middle">menubutton</cell>
<cell align="left" valign="middle">menubar, window, frame</cell>
</row>
<row>
<cell align="left" valign="middle">gridline</cell>
<cell align="left" valign="middle">grid</cell>
</row>
<row>
<cell align="left" valign="middle">menuitem</cell>
<cell align="left" valign="middle">menu</cell>
</row>
<row>
<cell align="left" valign="middle">menu</cell>
<cell align="left" valign="middle">menubutton, menuitem (with {itemtype, cascade}), window, frame (the last two are for pop-up menus)</cell>
</row>
<tcaption>Relations Between Objects and Container Objects</tcaption>
</table>
</section>
<section>
<title>Generic Options</title>
<p>Most objects have a common subset of options and will be referred to as generic options. They apply to most objects.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">beep</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">A beep will sound. Applies to all objects.</cell>
</row>
<row>
<cell align="left" valign="middle">{bg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Background color. Applies to objects which have a background color.</cell>
</row>
<row>
<cell align="left" valign="middle">{data, Term}</cell>
<cell align="left" valign="middle">[]</cell>
<cell align="left" valign="middle">Always delivered with the event in the data field. Applies to all objects.</cell>
</row>
<row>
<cell align="left" valign="middle">{default,Objecttype,{Key,Value}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Applies to all container objects. Specifies the default value for an option for children of type Objecttype.</cell>
</row>
<row>
<cell align="left" valign="middle">{enable, Bool}</cell>
<cell align="left" valign="middle">true</cell>
<cell align="left" valign="middle">Objects can be enabled or disabled. A disabled object cannot be clicked on, and text cannot be entered. Applies to buttons, menuitem, entry, editor, scale.</cell>
</row>
<row>
<cell align="left" valign="middle">{font, Font}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Applies to all text related objects and the grid.</cell>
</row>
<row>
<cell align="left" valign="middle">{fg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Foreground color. Applies to objects which have a foreground color.</cell>
</row>
<row>
<cell align="left" valign="middle">flush</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Ensures that front-end and back-end are synchronized. Applies to all objects.</cell>
</row>
<row>
<cell align="left" valign="middle">{setfocus, Bool}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Set or remove keyboard focus to this object. Applies to objects which can receive keyboard events.</cell>
</row>
<tcaption>Generic Options</tcaption>
</table>
<p>The following options apply to objects which can have a <em>frame</em> as parent. Coordinates are relative to the parent.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{cursor, Cursor}</cell>
<cell align="left" valign="middle">parent</cell>
<cell align="left" valign="middle">The appearance of the mouse cursor.</cell>
</row>
<row>
<cell align="left" valign="middle">{height, Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The height in pixels.</cell>
</row>
<row>
<cell align="left" valign="middle">{pack_x, Column|{StartColumn,EndColumn}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Packing position. See The Packer section.</cell>
</row>
<row>
<cell align="left" valign="middle">{pack_y, row|{Startrow,Endrow}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Packing position. See The Packer section.</cell>
</row>
<row>
<cell align="left" valign="middle">{pack_xy, {Column,row}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Packing position. See The Packer section.</cell>
</row>
<row>
<cell align="left" valign="middle">{width, Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The width in pixels.</cell>
</row>
<row>
<cell align="left" valign="middle">{x, Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The x coordinate within the parent objects frame in pixels. 0 is to the left.</cell>
</row>
<row>
<cell align="left" valign="middle">{y, Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The y coordinate in pixels. 0 is at the top.</cell>
</row>
<tcaption>Generic Options (Frame as Parent)</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Config-Only</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">lower</cell>
<cell align="left" valign="middle">Lowers this object to the bottom in the visual hierarchy.</cell>
</row>
<row>
<cell align="left" valign="middle">raise</cell>
<cell align="left" valign="middle">Lowers this object in the visual hierarchy.</cell>
</row>
<tcaption>Generic Config-Only Options</tcaption>
</table>
<p>The following table lists generic Read-Only options:</p>
<table>
<row>
<cell align="left" valign="middle"><em>Read-Only</em></cell>
<cell align="left" valign="middle"><em>Return</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">children</cell>
<cell align="left" valign="middle">[ObjectId1, ..., ObjectIdN]</cell>
<cell align="left" valign="middle">All children</cell>
</row>
<row>
<cell align="left" valign="middle">{choose_font,Font}</cell>
<cell align="left" valign="middle">Font</cell>
<cell align="left" valign="middle">Return the font that is actually used if a particular font is given.</cell>
</row>
<row>
<cell align="left" valign="middle">id</cell>
<cell align="left" valign="middle">ObjectId</cell>
<cell align="left" valign="middle">Return the object id for this object. Useful if the object is a named object.</cell>
</row>
<row>
<cell align="left" valign="middle">{font_wh,{Font,Text}}</cell>
<cell align="left" valign="middle">{Width,Height}</cell>
<cell align="left" valign="middle">Return the size of a text in a specified font. It returns the size of the font that is actually chosen by the back-end.</cell>
</row>
<row>
<cell align="left" valign="middle">type</cell>
<cell align="left" valign="middle">Atom</cell>
<cell align="left" valign="middle">The type of this object.</cell>
</row>
<row>
<cell align="left" valign="middle">parent</cell>
<cell align="left" valign="middle">ObjectId</cell>
<cell align="left" valign="middle">The parent of this object.</cell>
</row>
<tcaption>Generic Read-Only Options</tcaption>
</table>
<section>
<title>Generic Event Options</title>
<p>The table below lists all generic event options:
</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
</row>
<row>
<cell align="left" valign="middle">{buttonpress, Bool}</cell>
<cell align="left" valign="middle">false</cell>
</row>
<row>
<cell align="left" valign="middle">{buttonrelease, Bool}</cell>
<cell align="left" valign="middle">false</cell>
</row>
<row>
<cell align="left" valign="middle">{enter, Bool}</cell>
<cell align="left" valign="middle">false</cell>
</row>
<row>
<cell align="left" valign="middle">{leave, Bool}</cell>
<cell align="left" valign="middle">false</cell>
</row>
<row>
<cell align="left" valign="middle">{keypress, Bool}</cell>
<cell align="left" valign="middle">false</cell>
</row>
<row>
<cell align="left" valign="middle">{motion, Bool}</cell>
<cell align="left" valign="middle">false</cell>
</row>
<tcaption>Generic Event Options</tcaption>
</table>
</section>
</section>
<section>
<title>Window</title>
<p>The basic object is the window object. It is the most common container object. All graphical applications use at least one (top-level) window.</p>
<marker id="gs_fig8"></marker>
<image file="images/window.gif">
<icaption>Empty Window titled "A Window".</icaption>
</image>
<p>The following tables show all window specific options:</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{bg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">{R,G,B} or a color name</cell>
</row>
<row>
<cell align="left" valign="middle">{configure,Bool}</cell>
<cell align="left" valign="middle">false</cell>
<cell align="left" valign="middle">Will generate a <c><![CDATA[configure]]></c>event when the window has been resized or moved. The <c><![CDATA[Args]]></c>field contains [Width,Height,X,Y|_]</cell>
</row>
<row>
<cell align="left" valign="middle">{destroy,Bool}</cell>
<cell align="left" valign="middle">true</cell>
<cell align="left" valign="middle">Will generate a <c><![CDATA[destroy]]></c>event when the window is destroyed from the window manager. All GS applications should handle this event.</cell>
</row>
<row>
<cell align="left" valign="middle">{iconname, String}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle"> </cell>
</row>
<row>
<cell align="left" valign="middle">{iconify, Bool}</cell>
<cell align="left" valign="middle">false</cell>
<cell align="left" valign="middle"> </cell>
</row>
<row>
<cell align="left" valign="middle">{map, Bool}</cell>
<cell align="left" valign="middle">false</cell>
<cell align="left" valign="middle">Make it visible on the screen</cell>
</row>
<row>
<cell align="left" valign="middle">{title, String}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The title of the window. The default is the internal widget name which is platform specific.</cell>
</row>
<tcaption>Window Options</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Config-Only</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">raise</cell>
<cell align="left" valign="middle">Raise window on top of all other windows.</cell>
</row>
<row>
<cell align="left" valign="middle">lower</cell>
<cell align="left" valign="middle">Lower window to background.</cell>
</row>
<tcaption>Window Config-Only Options</tcaption>
</table>
<p>The following example shows how to create a window and configure it to enable various events.</p>
<codeinclude file="examples/ex7.erl" tag="" type="erl"></codeinclude>
</section>
<section>
<title>Button</title>
<marker id="gs_fig9"></marker>
<image file="images/buttons.gif">
<icaption>Radio Buttons, Check Buttons, and Ordinary Button</icaption>
</image>
<p>Buttons are the simplest and the most commonly used objects. You press them and get a click event. The following tables show the options for all button types.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{align, Align}</cell>
<cell align="left" valign="middle">center</cell>
<cell align="left" valign="middle">Text alignment within the frame.</cell>
</row>
<row>
<cell align="left" valign="middle">{justify, left | center | right}</cell>
<cell align="left" valign="middle">center</cell>
<cell align="left" valign="middle">Justification is only valid when there are several lines of text.</cell>
</row>
<row>
<cell align="left" valign="middle">{label, Label}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Text or image to show.</cell>
</row>
<row>
<cell align="left" valign="middle">{select, Bool}</cell>
<cell align="left" valign="middle">false</cell>
<cell align="left" valign="middle">Check buttons and radio buttons. true means that the button is selected.</cell>
</row>
<row>
<cell align="left" valign="middle">{underline, Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Underline character N to indicate a keyboard accelerator.</cell>
</row>
<row>
<cell align="left" valign="middle">{group, Atom}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Radio button: only one per group is selected at one time. Check button: All in the same group are selected automatically.</cell>
</row>
<row>
<cell align="left" valign="middle">{value, Atom}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Radio buttons only. Groups radio buttons together within a group.</cell>
</row>
<tcaption>Options for all Button Types</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Config-Only</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">flash</cell>
<cell align="left" valign="middle">Flash button</cell>
</row>
<row>
<cell align="left" valign="middle">invoke</cell>
<cell align="left" valign="middle">Explicit button press.</cell>
</row>
<row>
<cell align="left" valign="middle">toggle</cell>
<cell align="left" valign="middle">Check buttons only. Toggles select value.</cell>
</row>
<tcaption>Config-Only Options for all Button types</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Buttontype</em></cell>
<cell align="left" valign="middle"><em>Event</em></cell>
</row>
<row>
<cell align="left" valign="middle">normal</cell>
<cell align="left" valign="middle">{gs, itemId, click, Data, [Text| _]}</cell>
</row>
<row>
<cell align="left" valign="middle">check</cell>
<cell align="left" valign="middle">{gs, itemId, click, Data, [Text, Group, Bool | _]}</cell>
</row>
<row>
<cell align="left" valign="middle">radio</cell>
<cell align="left" valign="middle">{gs, itemId, click, Data, [Text, Group, Value | _]}</cell>
</row>
<tcaption>>Events for all Button types</tcaption>
</table>
<p>Buttons and check buttons are simple to understand, radio buttons are more difficult. Each radio button has a group and a value option. The group option is used to group together two or more radio buttons. Normally, each radio button within a group has a unique value which means that only one radio button can be selected at a time. If two (or more) radio buttons share the same value and one of them is selected, then both will be selected and all others are de-selected. The following short example shows how to program radio button logic in a situation where two of them share the same value.</p>
<codeinclude file="examples/ex8.erl" tag="" type="erl"></codeinclude>
<marker id="gs_fig10"></marker>
<image file="images/ex8.gif">
<icaption>Radio Button Group with Last Button Selected</icaption>
</image>
<p>The example shown creates three radio buttons which are members of the same group. The default behavior is that all radio buttons created by the same process are members of the same group. Normally, only one in a group may be selected at the same time, but since we defined the value-option to have the same value for <c><![CDATA[rb1]]></c> and <c><![CDATA[rb2]]></c>, they will both be selected/de-selected simultaneously. The normal radio button group behavior is that all radio buttons within the same group have unique default values.</p>
</section>
<section>
<title>Label</title>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{align,Align}</cell>
<cell align="left" valign="middle">center</cell>
<cell align="left" valign="middle">How the text is aligned within the frame.</cell>
</row>
<row>
<cell align="left" valign="middle">{justify,left|right|center}</cell>
<cell align="left" valign="middle">left</cell>
<cell align="left" valign="middle">How to justify several lines of text.</cell>
</row>
<row>
<cell align="left" valign="middle">{label,Label}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Text or image to show.</cell>
</row>
<row>
<cell align="left" valign="middle">{underline,Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Underline character N to indicate a keyboard accelerator.</cell>
</row>
<tcaption>Label Options</tcaption>
</table>
<p>A label is a simple text field which is used to display text to the user. It is possible to have several lines of text by inserting newline '\
' characters between each line. The label object does not automatically adjust its size so that text will fit inside. This has to be done manually, or the text may be clipped at the edges.</p>
</section>
<section>
<title>Frame</title>
<p>The frame object acts as a container for other objects. Its main use is to logically and visually group objects together. Grouped objects can then be moved, displayed, or hidden in one single operation.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{bw,Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Border width</cell>
</row>
<row>
<cell align="left" valign="middle">{packer_x,PackList}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Makes the frame pack its children. See the packer section.</cell>
</row>
<row>
<cell align="left" valign="middle">{packer_y,PackList}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Makes the frame pack its children. See the packer section.</cell>
</row>
<tcaption>Frame Options</tcaption>
</table>
<p>It is possible to have frame objects within frame objects so that large hierarchical structures of objects can be created.</p>
</section>
<section>
<title>Entry</title>
<marker id="gs_fig11"></marker>
<image file="images/ex9.gif">
<icaption>Label and Entry Objects for User Input</icaption>
</image>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{justify, left|right|center}</cell>
<cell align="left" valign="middle">left</cell>
<cell align="left" valign="middle">Text justification in entry field.</cell>
</row>
<row>
<cell align="left" valign="middle">{text, String}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Use this option to initially set some text, and to read the text.</cell>
</row>
<tcaption>Entry Options</tcaption>
</table>
<p>Entrys are used to prompt the user for text input.</p>
<table>
<row>
<cell align="left" valign="middle"><em>Config-Only</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{delete, {From, To}}</cell>
<cell align="left" valign="middle">Deletes the characters within index {From,To}.</cell>
</row>
<row>
<cell align="left" valign="middle">{delete, last}</cell>
<cell align="left" valign="middle">Deletes the last character.</cell>
</row>
<row>
<cell align="left" valign="middle">{delete, Index}</cell>
<cell align="left" valign="middle">Deletes the character at position Index.</cell>
</row>
<row>
<cell align="left" valign="middle">{insert, {Index, String}}</cell>
<cell align="left" valign="middle">Inserts text at the specific character position. Index starts from 0.</cell>
</row>
<row>
<cell align="left" valign="middle">{select, {From, To}}</cell>
<cell align="left" valign="middle">Selects a range.</cell>
</row>
<row>
<cell align="left" valign="middle">{select, clear}</cell>
<cell align="left" valign="middle">De-selects selected text.</cell>
</row>
<tcaption>Entry Config-Only Options</tcaption>
</table>
<p>A common usage of the entry object is to listen for the 'Return' key event and then read the text field. The following example shows a simple dialog which prompts the user for a name and returns the tuple <c><![CDATA[{name,Name}]]></c> when a name is entered, or <c><![CDATA[cancel]]></c> if the cancel button is pressed.</p>
<codeinclude file="examples/ex9.erl" tag="" type="erl"></codeinclude>
<p>The program draws the dialog and waits for the user to either press the return key or click one of the buttons. It then reads the text option of the entry and returns the string to the client process.</p>
</section>
<section>
<title>Listbox</title>
<p>A listbox is a list of labels with optional scroll bars attached. The user selects one or more predefined alternative entries. You can add and remove entries in the listbox. The first element in a listbox has index 0.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{hscroll, Bool | top | bottom}</cell>
<cell align="left" valign="middle">true</cell>
<cell align="left" valign="middle">Horizontal scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{items, [String, String ... String]}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">All items (entries) in the listbox.</cell>
</row>
<row>
<cell align="left" valign="middle">{scrollbg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Foreground color of scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{scrollfg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Background color of scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{selectmode, single | multiple}</cell>
<cell align="left" valign="middle">single</cell>
<cell align="left" valign="middle">Controls if it is possible to have several items selected at the same time.</cell>
</row>
<row>
<cell align="left" valign="middle">{vscroll, Bool | left | right}</cell>
<cell align="left" valign="middle">true</cell>
<cell align="left" valign="middle">Vertical scroll bar.</cell>
</row>
<tcaption>Listbox Options</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Config-Only</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{add, {Index, String}}</cell>
<cell align="left" valign="middle">Add an item at specified index.</cell>
</row>
<row>
<cell align="left" valign="middle">{add, String}</cell>
<cell align="left" valign="middle">Add an item last.</cell>
</row>
<row>
<cell align="left" valign="middle">{change, {Index,String}}</cell>
<cell align="left" valign="middle">Change one item.</cell>
</row>
<row>
<cell align="left" valign="middle">clear</cell>
<cell align="left" valign="middle">Delete all items.</cell>
</row>
<row>
<cell align="left" valign="middle">{del, Index | {From, To}}</cell>
<cell align="left" valign="middle">Delete an item at specified index, or all from index From to index To.</cell>
</row>
<row>
<cell align="left" valign="middle">{see, Index}</cell>
<cell align="left" valign="middle">Make the item at specified index visible.</cell>
</row>
<row>
<cell align="left" valign="middle">{selection, Index | {From,To}| clear}</cell>
<cell align="left" valign="middle">Select an item (highlight it). Clear erases the selection.</cell>
</row>
<tcaption>Listbox Cinfig-only Options</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Read-Only</em></cell>
<cell align="left" valign="middle"><em>Return</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">selection</cell>
<cell align="left" valign="middle">ListOfStrings</cell>
<cell align="left" valign="middle">Returns current selection. All selected item indices will be returned in a list.</cell>
</row>
<row>
<cell align="left" valign="middle">size</cell>
<cell align="left" valign="middle">Int</cell>
<cell align="left" valign="middle">The number of items (entries) in the listbox.</cell>
</row>
<row>
<cell align="left" valign="middle">{get, Index}</cell>
<cell align="left" valign="middle">String</cell>
<cell align="left" valign="middle">Returns item at specified index.</cell>
</row>
<tcaption>Listbox Read-Only Options</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Event</em></cell>
</row>
<row>
<cell align="left" valign="middle">{gs, ListBox, click, Data, [Index, Text,Bool | _]}</cell>
</row>
<row>
<cell align="left" valign="middle">{gs, ListBox, doubleclick, Data, [Index, Text,Bool | _]}</cell>
</row>
<tcaption>Listbox Events</tcaption>
</table>
<p><c><![CDATA[Bool]]></c> is true if object is selected, false if de-selected.</p>
<p>Note that <c><![CDATA[click]]></c> and <c><![CDATA[doubleclick]]></c> are two discrete events: if you have subscribed to both, you will receive both a <c><![CDATA[click]]></c> event and a <c><![CDATA[doubleclick]]></c> event when double-clicking on one item (since two rapid clickings are regarded as both a <c><![CDATA[click]]></c> and a <c><![CDATA[doubleclick]]></c>). The subscription of <c><![CDATA[doubleclick]]></c> events does <c><![CDATA[not]]></c> result in the <c><![CDATA[click]]></c> events being unsubscribed!</p>
<p>The following example shows a simple application which prompts the user for a text item. The user has the following options:</p>
<list type="bulleted">
<item>browse the items and then double-click the required item</item>
<item>type the name into the entry field and then press the Return key</item>
<item>select the required item and then click the OK button.</item>
</list>
<marker id="gs_fig12"></marker>
<image file="images/ex1.gif">
<icaption>
Simple Browser Dialog</icaption>
</image>
<codeinclude file="examples/ex10.erl" tag="" type="erl"></codeinclude>
</section>
<section>
<title>Canvas</title>
<p>The canvas object is a simple drawing area. The user can draw graphical objects and move them around the drawing area. The canvas also has optional scroll bars which can be used to scroll the drawing area. The graphical objects that can be created on a canvas object are:</p>
<list type="bulleted">
<item>arc</item>
<item>image</item>
<item>line</item>
<item>oval</item>
<item>polygon</item>
<item>rectangle</item>
<item>text.</item>
</list>
<p>These objects must have a canvas object as a parent, but they are otherwise similar to all other basic objects. The following tables show the options which apply to canvas objects.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{bg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Color of the drawing area.</cell>
</row>
<row>
<cell align="left" valign="middle">{hscroll, Bool | top | bottom}</cell>
<cell align="left" valign="middle">false</cell>
<cell align="left" valign="middle">Horizontal scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{scrollbg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Foreground color of scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{scrollfg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Background color of scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{scrollregion, {X1,Y1,X2,Y2}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The size of the drawing area to be scrolled. </cell>
</row>
<row>
<cell align="left" valign="middle">{vscroll, Bool | left | right}</cell>
<cell align="left" valign="middle">false</cell>
<cell align="left" valign="middle">Vertical scroll bar.</cell>
</row>
<tcaption>Canvas Options</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Read-Only</em></cell>
<cell align="left" valign="middle"><em>Return</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{hit, {X,Y}}</cell>
<cell align="left" valign="middle">list of ObjectId</cell>
<cell align="left" valign="middle">Returns the canvas objects at X,Y.</cell>
</row>
<row>
<cell align="left" valign="middle">{hit, [{X1,Y1},{X2,Y2}]}</cell>
<cell align="left" valign="middle">list of ObjectId</cell>
<cell align="left" valign="middle">Returns the canvas objects which are hit by the rectangle.</cell>
</row>
<tcaption>Canvas Read-Only Options</tcaption>
</table>
<p>Canvas objects have the same types of events as other objects. The following Config-Only options also apply to canvas objects:</p>
<table>
<row>
<cell align="left" valign="middle"><em>Config-Only</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">lower</cell>
<cell align="left" valign="middle">Lowers the object.</cell>
</row>
<row>
<cell align="left" valign="middle">{move, {Dx, Dy}}</cell>
<cell align="left" valign="middle">Moves object relative to its current position.</cell>
</row>
<row>
<cell align="left" valign="middle">raise</cell>
<cell align="left" valign="middle">Raises the object above all other objects.</cell>
</row>
<tcaption>Canvas Config-Only Options</tcaption>
</table>
<p>The following sections describe the graphical objects which can be drawn on a canvas object.</p>
<section>
<title>The Canvas Arc Object</title>
<p>The canvas arc object is defined within a rectangle and is drawn from a start angle to the extent angle. Origo is in the center of the rectangle.</p>
<marker id="gs_fig13"></marker>
<image file="images/arc.gif">
<icaption>Canvas Arc Object</icaption>
</image>
<code type="none"><![CDATA[
gs:create(arc,Canvas,[{coords,[{10,10},{80,80}]},{fill,yellow}]).
]]></code>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{bw, Int}</cell>
<cell align="left" valign="middle">1</cell>
<cell align="left" valign="middle">Defines the width.</cell>
</row>
<row>
<cell align="left" valign="middle">{coords, [{X1,Y1},{X2,Y2}]}</cell>
<cell align="left" valign="middle"> </cell>
<cell align="left" valign="middle">Defines a rectangle to draw the arc within.</cell>
</row>
<row>
<cell align="left" valign="middle">{extent, Degrees}</cell>
<cell align="left" valign="middle"> </cell>
<cell align="left" valign="middle"> </cell>
</row>
<row>
<cell align="left" valign="middle">{fg, Color}</cell>
<cell align="left" valign="middle"> </cell>
<cell align="left" valign="middle"> </cell>
</row>
<row>
<cell align="left" valign="middle">{fill, Color|none}</cell>
<cell align="left" valign="middle">none</cell>
<cell align="left" valign="middle">Defines fill color of arc object.</cell>
</row>
<row>
<cell align="left" valign="middle">{start, Degrees}</cell>
<cell align="left" valign="middle"> </cell>
<cell align="left" valign="middle"> </cell>
</row>
<row>
<cell align="left" valign="middle">{style, arc}</cell>
<cell align="left" valign="middle"> </cell>
<cell align="left" valign="middle">No line segments.</cell>
</row>
<row>
<cell align="left" valign="middle">{style, chord}</cell>
<cell align="left" valign="middle"> </cell>
<cell align="left" valign="middle">A single line segment connects the two end points of the perimeter section.</cell>
</row>
<row>
<cell align="left" valign="middle">{style, pieslice}</cell>
<cell align="left" valign="middle">This Style</cell>
<cell align="left" valign="middle">Two lines are drawn between the center of the oval and each end of the perimeter section.</cell>
</row>
<tcaption>Canvas Arc Options</tcaption>
</table>
</section>
<section>
<title>The Canvas Image Object</title>
<p>The canvas image object displays images and moves them around in a simple way. The currently supported image formats are bitmap and gif.</p>
<marker id="gs_fig14"></marker>
<image file="images/image.gif">
<icaption>Canvas Image Object</icaption>
</image>
<code type="none"><![CDATA[
gs:create(image,Canvas,[{load_gif,"brick.gif"}]).
]]></code>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{anchor, Anchor}</cell>
<cell align="left" valign="middle">nw</cell>
<cell align="left" valign="middle">Anchor reference specified by {X,Y} .</cell>
</row>
<row>
<cell align="left" valign="middle">{bg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Background color. Pixel value 0.</cell>
</row>
<row>
<cell align="left" valign="middle">{bitmap, FileName}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">A bitmap file which contains a bmp bitmap.</cell>
</row>
<row>
<cell align="left" valign="middle">{coords, [{X,Y}]}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Position on the canvas.</cell>
</row>
<row>
<cell align="left" valign="middle">{fg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Foreground color. Pixel value 1.</cell>
</row>
<row>
<cell align="left" valign="middle">{load_gif, FileName}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Loads a gif image.</cell>
</row>
<tcaption>Canvas Image Object Options</tcaption>
</table>
</section>
<section>
<title>The Canvas Line Object</title>
<marker id="gs_fig15"></marker>
<image file="images/line.gif">
<icaption>Line Object Drawn on a Canvas</icaption>
</image>
<code type="none"><![CDATA[
gs:create(line,Canvas,
[{coords,[{25,25},{50,50},{50,40},{85,75}]},
{arrow,last},{width,2}]).
]]></code>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{arrow, both | none | first | last}</cell>
<cell align="left" valign="middle">none</cell>
<cell align="left" valign="middle">Draws arrows at the end points of the line.</cell>
</row>
<row>
<cell align="left" valign="middle">{coords, [{X1,Y1},{X2,Y2}, ... {Xn,Yn}]}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">A list of coordinates. The line will be drawn between all pairs in the list.</cell>
</row>
<row>
<cell align="left" valign="middle">{fg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The color of the line.</cell>
</row>
<row>
<cell align="left" valign="middle">{smooth, Bool}</cell>
<cell align="left" valign="middle">false</cell>
<cell align="left" valign="middle">Smoothing with Bezier splines.</cell>
</row>
<row>
<cell align="left" valign="middle">{splinesteps, Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle"> </cell>
</row>
<row>
<cell align="left" valign="middle">{width, Int}</cell>
<cell align="left" valign="middle">1</cell>
<cell align="left" valign="middle">The width of the line.</cell>
</row>
<tcaption>Canvas Line Object Options</tcaption>
</table>
</section>
<section>
<title>The Canvas Oval Object</title>
<marker id="gs_fig16"></marker>
<image file="images/oval.gif">
<icaption>Oval Object Drawn on a Canvas</icaption>
</image>
<code type="none"><![CDATA[
gs:create(oval,Canvas,
[{coords,[{25,25},{125,75}]},{fill,red},{bw,2}]).
]]></code>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{bw, Int}</cell>
<cell align="left" valign="middle">1</cell>
<cell align="left" valign="middle">Width.</cell>
</row>
<row>
<cell align="left" valign="middle">{coords, [{X1,Y1},{X2,Y2}]}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Bounding rectangle which defines shape of object.</cell>
</row>
<row>
<cell align="left" valign="middle">{fg, Color}</cell>
<cell align="left" valign="middle"> </cell>
<cell align="left" valign="middle"> </cell>
</row>
<row>
<cell align="left" valign="middle">{fill, Color|none}</cell>
<cell align="left" valign="middle">none</cell>
<cell align="left" valign="middle">Object fill color.</cell>
</row>
<tcaption>Canvas Oval Object Options</tcaption>
</table>
</section>
<section>
<title>The Canvas Polygon Object</title>
<marker id="gs_fig17"></marker>
<image file="images/polygon.gif">
<icaption>Canvas Polygon Object</icaption>
</image>
<code type="none"><![CDATA[
gs:create(polygon,Canvas,
[{coords,[{10,10},{50,50},{75,30}]}]).
]]></code>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{bw, Int}</cell>
<cell align="left" valign="middle">1</cell>
<cell align="left" valign="middle">Width.</cell>
</row>
<row>
<cell align="left" valign="middle">{coords, [{X1,Y1},{X2,Y2} | {Xn,Yn}]}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Defines all points in the polygon. There may be any number of points in the polygon.</cell>
</row>
<row>
<cell align="left" valign="middle">{fg, Color}</cell>
<cell align="left" valign="middle">black</cell>
<cell align="left" valign="middle">The color of the polygon outline. </cell>
</row>
<row>
<cell align="left" valign="middle">{fill, Color|none}</cell>
<cell align="left" valign="middle">none</cell>
<cell align="left" valign="middle"> </cell>
</row>
<row>
<cell align="left" valign="middle">{smooth, Bool}</cell>
<cell align="left" valign="middle">false</cell>
<cell align="left" valign="middle">Smoothing with Bezier splines.</cell>
</row>
<row>
<cell align="left" valign="middle">{splinesteps, Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle"> </cell>
</row>
<tcaption>Canvas Polygon Object Options</tcaption>
</table>
</section>
<section>
<title>The Canvas Rectangle Object</title>
<marker id="gs_fig18"></marker>
<image file="images/rectangle.gif">
<icaption>Rectangle Object Created on a Canvas</icaption>
</image>
<code type="none"><![CDATA[
gs:create(rectangle,Canvas,
[{coords,[{30,30},{70,70}]},{fill,cyan},{bw,2}]).
]]></code>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{bw, Int}</cell>
<cell align="left" valign="middle">1</cell>
<cell align="left" valign="middle">The width of the border line.</cell>
</row>
<row>
<cell align="left" valign="middle">{coords, [{X1,Y1},{X2,Y2}]}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Defines rectangle coordinates.</cell>
</row>
<row>
<cell align="left" valign="middle">{fg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The color of the border line.</cell>
</row>
<row>
<cell align="left" valign="middle">{fill, Color|none}</cell>
<cell align="left" valign="middle">none</cell>
<cell align="left" valign="middle">Fill color of rectangle.</cell>
</row>
<tcaption>Canvas Rectangle Object Options</tcaption>
</table>
</section>
<section>
<title>The Canvas Text Object</title>
<marker id="gs_fig19"></marker>
<image file="images/text.gif">
<icaption>Canvas Text Object</icaption>
</image>
<code type="none"><![CDATA[
gs:create(text,C,[{coords,[{50,50}]},
{font,{times,18}},
{fg,red},
{text,"Hello World!"}]).
]]></code>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{anchor, Anchor}</cell>
<cell align="left" valign="middle">nw</cell>
<cell align="left" valign="middle">Anchor reference specified by {X,Y}.</cell>
</row>
<row>
<cell align="left" valign="middle">{coords, [{X, Y}]}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Position in the canvas.</cell>
</row>
<row>
<cell align="left" valign="middle">{fg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Text color (background color is the canvas color).</cell>
</row>
<row>
<cell align="left" valign="middle">{justify, left | center | right}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Tex justification. Only valid with several lines of text.</cell>
</row>
<row>
<cell align="left" valign="middle">{text, String}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The text string to display.</cell>
</row>
<row>
<cell align="left" valign="middle">{width, Int}</cell>
<cell align="left" valign="middle"> </cell>
<cell align="left" valign="middle">The width in pixels. The text will be wrapped into several lines to fit inside the width.</cell>
</row>
<tcaption>Canvas Text Object Options</tcaption>
</table>
</section>
</section>
<section>
<title>Menu</title>
<p>Menus consist of four object types:</p>
<list type="bulleted">
<item>the menu bar</item>
<item>the menu button</item>
<item>the menu</item>
<item>the menu item.</item>
</list>
<section>
<title>Menu Bar</title>
<p>The menu bar is a simple object. It is placed at the top of the window and contains menu items. {x,y} or width cannot be controlled since, by definition, the menu bar is placed at the top of the window.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle"><only generic options></cell>
<cell align="left" valign="middle"> </cell>
<cell align="left" valign="middle"> </cell>
</row>
<tcaption>Menu Bar Options</tcaption>
</table>
</section>
<section>
<title>Menu Button</title>
<p>The menu button displays a menu when pressed. The width of the menu button is automatically determined by the size of the text.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{align, Align}</cell>
<cell align="left" valign="middle">center</cell>
<cell align="left" valign="middle">Text alignment within the frame.</cell>
</row>
<row>
<cell align="left" valign="middle">{justify, left | center | right}</cell>
<cell align="left" valign="middle">center</cell>
<cell align="left" valign="middle">Justification is only valid when there are several lines of text.</cell>
</row>
<row>
<cell align="left" valign="middle">{label,{text,Text}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle"> </cell>
</row>
<row>
<cell align="left" valign="middle">{side, left | right}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Placement on the menu bar. The menu button created first will have the left/right position.</cell>
</row>
<row>
<cell align="left" valign="middle">{underline, Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Underline character N to indicate an keyboard accelerator.</cell>
</row>
<tcaption>Menu Button Options</tcaption>
</table>
</section>
<section>
<title>Menu</title>
<p>The menu contains menu items, which are displayed vertically. Its width is automatically determined by the width of the menu items it contains.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{selectcolor, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The indicator color of radio buttons and check buttons.</cell>
</row>
<tcaption>Menu Options</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Config-Only</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{post_at,{X,Y}}</cell>
<cell align="left" valign="middle">Displays the menu as a pop-up menu at {X,Y} (coordinate system of the parent).</cell>
</row>
<tcaption>Menu Config-Only Options</tcaption>
</table>
</section>
<section>
<title>Menu Item</title>
<p>The menu item is an object of its own. It can send events when the user selects it.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{group, Atom}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">For {type, radio|check}.</cell>
</row>
<row>
<cell align="left" valign="middle">{itemtype, type}</cell>
<cell align="left" valign="middle">normal</cell>
<cell align="left" valign="middle">The type of this item. Cannot be reconfigured.</cell>
</row>
<row>
<cell align="left" valign="middle">{label, {text,Text}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The text of the item.</cell>
</row>
<row>
<cell align="left" valign="middle">{underline, Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Underline character N to indicate an keyboard accelerator.</cell>
</row>
<row>
<cell align="left" valign="middle">{value, Atom}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle"> </cell>
</row>
<tcaption>Menu Item Options</tcaption>
</table>
<p><c><![CDATA[type: normal | separator | check | radio | cascade]]></c></p>
<table>
<row>
<cell align="left" valign="middle"><em>itemtype</em></cell>
<cell align="left" valign="middle"><em>Event</em></cell>
</row>
<row>
<cell align="left" valign="middle">normal</cell>
<cell align="left" valign="middle">{gs, itemId, click, Data, [Text, Index | _]}</cell>
</row>
<row>
<cell align="left" valign="middle">check</cell>
<cell align="left" valign="middle">{gs, itemId, click, Data, [Text, Index, Group, Bool| _]}</cell>
</row>
<row>
<cell align="left" valign="middle">radio</cell>
<cell align="left" valign="middle">{gs, itemId, click, Data, [Text, Index, Group, Value| _]}</cell>
</row>
<tcaption>Menu Item Events</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Read-Only</em></cell>
<cell align="left" valign="middle"><em>Return</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">index</cell>
<cell align="left" valign="middle">Int</cell>
<cell align="left" valign="middle">Index in the menu. Starts counting from 0.</cell>
</row>
<tcaption>Menu Item Read-Only Options</tcaption>
</table>
</section>
<section>
<title>Menu Demo</title>
<marker id="gs_fig20"></marker>
<image file="images/ex13.gif">
<icaption>Simple Menu</icaption>
</image>
<p>The following example shows a short demo of the <c><![CDATA[gs]]></c> menus:</p>
<codeinclude file="examples/ex13.erl" tag="" type="erl"></codeinclude>
</section>
</section>
<section>
<title>Grid</title>
<p>The grid object is similar to the listbox object. The main difference is that the grid is a multi-column object which is used to display tables. If needed, the grid can send click events when a user presses the mouse button in a table cell. Although the grid has a behavior which is similar to the listbox, the programming is somewhat different. The data in a table cell is represented as a pure <c><![CDATA[gs]]></c> object and can be treated as such. This object is called a grid line. It is located at a row in the parent grid. If a grid line is clicked, it sends an event to its owner.</p>
<section>
<title>Grid Line</title>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{{bg, Column},Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The background color of a cell.</cell>
</row>
<row>
<cell align="left" valign="middle">{bg, {Column,Color}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Equivalent to {{bg, Column},Color}.</cell>
</row>
<row>
<cell align="left" valign="middle">{bg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The background color of all cells.</cell>
</row>
<row>
<cell align="left" valign="middle">{click, Bool}</cell>
<cell align="left" valign="middle">true</cell>
<cell align="left" valign="middle">Turns click events on/off.</cell>
</row>
<row>
<cell align="left" valign="middle">{doubleclick, Bool}</cell>
<cell align="left" valign="middle">false</cell>
<cell align="left" valign="middle">Turns double-click events on/off.</cell>
</row>
<row>
<cell align="left" valign="middle">{{fg, Column},Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The foreground color of a cell.</cell>
</row>
<row>
<cell align="left" valign="middle">{fg, {Column,Color}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Equivalent to {{fg, Column},Color}</cell>
</row>
<row>
<cell align="left" valign="middle">{fg,Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The foreground color of all cells.</cell>
</row>
<row>
<cell align="left" valign="middle">{text, {Column,Text}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The text in the cell.</cell>
</row>
<row>
<cell align="left" valign="middle">{{text, Column},Text}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Equivalent to {text,{Column,Text}}.</cell>
</row>
<row>
<cell align="left" valign="middle">{text,Text}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The text for all cells.</cell>
</row>
<row>
<cell align="left" valign="middle">{row, {row}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The grid row. Must not be occupied by another grid line.</cell>
</row>
<tcaption>Grid Line Options</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Event</em></cell>
</row>
<row>
<cell align="left" valign="middle">{gs, GridLineId, click, Data, [Col, row, Text | _]}</cell>
</row>
<row>
<cell align="left" valign="middle">{gs, GridLineId, doubleclick, Data, [Col, row, Text | _]}</cell>
</row>
<tcaption>Gride Line Events</tcaption>
</table>
</section>
<section>
<title>Grid</title>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{font,Font}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">A "global" grid font.</cell>
</row>
<row>
<cell align="left" valign="middle">{hscroll, Bool|top|bottom}</cell>
<cell align="left" valign="middle">true</cell>
<cell align="left" valign="middle">Horizontal scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{vscoll, Bool|left|right}</cell>
<cell align="left" valign="middle">true</cell>
<cell align="left" valign="middle">Vertical scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{rows, {Minrow,Maxrow}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The rows which are currently displayed.</cell>
</row>
<row>
<cell align="left" valign="middle">{columnwidths, [WidthCol1,WidthCol2, ..., WidthColN}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Defines the number of columns and their widths in coordinates. The size of the columns can be reconfigured, but not the number of columns.</cell>
</row>
<row>
<cell align="left" valign="middle">{fg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The color of the grid pattern and the text.</cell>
</row>
<row>
<cell align="left" valign="middle">{bg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The background color.</cell>
</row>
<tcaption>Grid Options</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Read-Only</em></cell>
<cell align="left" valign="middle"><em>Return</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{obj_at_row, row}</cell>
<cell align="left" valign="middle">Object |undefined</cell>
<cell align="left" valign="middle">The grid line at row.</cell>
</row>
<tcaption>Grid Read-Only Options</tcaption>
</table>
<p>The rows and columns start counting at 1.</p>
</section>
<section>
<title>Grid Demo</title>
<marker id="gs_fig21"></marker>
<image file="images/ex12.gif">
<icaption>Simple Grid</icaption>
</image>
<p>The following simple example shows how to use the grid.</p>
<codeinclude file="examples/ex12.erl" tag="" type="erl"></codeinclude>
</section>
</section>
<section>
<title>Editor</title>
<p>The editor object is a simple text editor.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{hscroll, Bool | top | bottom}</cell>
<cell align="left" valign="middle">false</cell>
<cell align="left" valign="middle">Horizontal scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{insertpos,{row,Col}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The position of the cursor.</cell>
</row>
<row>
<cell align="left" valign="middle">{insertpos,'end'}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The position of the cursor.</cell>
</row>
<row>
<cell align="left" valign="middle">{justify, left| right| center}</cell>
<cell align="left" valign="middle">left</cell>
<cell align="left" valign="middle">Text justification.</cell>
</row>
<row>
<cell align="left" valign="middle">{scrollbg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Background color of scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{scrollfg, Color}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">Foreground color of scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{selection, {FromIndex,ToIndex}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The text range that is currently selected.</cell>
</row>
<row>
<cell align="left" valign="middle">{vscroll, Bool | left | right}</cell>
<cell align="left" valign="middle">false</cell>
<cell align="left" valign="middle">Vertical scroll bar.</cell>
</row>
<row>
<cell align="left" valign="middle">{vscrollpos, row}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The top most visible row in the editor.</cell>
</row>
<row>
<cell align="left" valign="middle">{wrap, none|char | word}</cell>
<cell align="left" valign="middle">none</cell>
<cell align="left" valign="middle">How to wrap text when the line is full.</cell>
</row>
<tcaption>Editor Options</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Config-Only</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">clear</cell>
<cell align="left" valign="middle">Clears the editor.</cell>
</row>
<row>
<cell align="left" valign="middle">{del, {FromIndex, ToIndex}}}</cell>
<cell align="left" valign="middle">Deletes text.</cell>
</row>
<row>
<cell align="left" valign="middle">{fg, {{FromIndex,ToIndex},Color}}</cell>
<cell align="left" valign="middle">Sets the foreground color of a range of text.</cell>
</row>
<row>
<cell align="left" valign="middle">{load, FileName}</cell>
<cell align="left" valign="middle">Read FileName into the editor.</cell>
</row>
<row>
<cell align="left" valign="middle">{insert, {Index, Text}}</cell>
<cell align="left" valign="middle">Inserts new text.</cell>
</row>
<row>
<cell align="left" valign="middle">{overwrite, {Index, Text}}</cell>
<cell align="left" valign="middle">Writes new text at index.</cell>
</row>
<row>
<cell align="left" valign="middle">{save, FileName}</cell>
<cell align="left" valign="middle">Writes editor contents to file.</cell>
</row>
<tcaption>Editor Config-Only Options</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Read-Only</em></cell>
<cell align="left" valign="middle"><em>Return</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">char_height</cell>
<cell align="left" valign="middle">Int</cell>
<cell align="left" valign="middle">The height of the editor window measured in characters.</cell>
</row>
<row>
<cell align="left" valign="middle">char_width</cell>
<cell align="left" valign="middle">Int</cell>
<cell align="left" valign="middle">The width of the editor window measured in characters.</cell>
</row>
<row>
<cell align="left" valign="middle">{fg,Index}</cell>
<cell align="left" valign="middle">Int</cell>
<cell align="left" valign="middle">The foreground color of the text at Index.</cell>
</row>
<row>
<cell align="left" valign="middle">{get,{FromIndex, ToIndex}}</cell>
<cell align="left" valign="middle">Text</cell>
<cell align="left" valign="middle">The text between the indices.</cell>
</row>
<row>
<cell align="left" valign="middle">size</cell>
<cell align="left" valign="middle">Int</cell>
<cell align="left" valign="middle">The number of rows in the editor.</cell>
</row>
<tcaption>Editor Read-Only Options</tcaption>
</table>
<code type="none"><![CDATA[
Index: 'end'|insert|{row,Col}|{row,lineend}
]]></code>
<section>
<title>Editor Demo</title>
<marker id="gs_fig22"></marker>
<image file="images/ex14.gif">
<icaption>Simple Editor</icaption>
</image>
<codeinclude file="examples/ex14.erl" tag="" type="erl"></codeinclude>
</section>
</section>
<section>
<title>Scale</title>
<p>A scale object is used to select a value within a specified range.</p>
<table>
<row>
<cell align="left" valign="middle"><em>{Option,Value}</em></cell>
<cell align="left" valign="middle"><em>Default</em></cell>
<cell align="left" valign="middle"><em>Description</em></cell>
</row>
<row>
<cell align="left" valign="middle">{orient, vertical | horizontal}</cell>
<cell align="left" valign="middle">horizontal</cell>
<cell align="left" valign="middle">The orientation of the scale.</cell>
</row>
<row>
<cell align="left" valign="middle">{pos, Int}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The current value of the scale objects within the range.</cell>
</row>
<row>
<cell align="left" valign="middle">{range, {Min, Max}}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">The value range.</cell>
</row>
<row>
<cell align="left" valign="middle">{showvalue, Bool}</cell>
<cell align="left" valign="middle">true</cell>
<cell align="left" valign="middle">Turns showing of scale value on/off.</cell>
</row>
<row>
<cell align="left" valign="middle">{text, String}</cell>
<cell align="left" valign="middle"><unspec></cell>
<cell align="left" valign="middle">If specified, a label will be attached to the scale.</cell>
</row>
<tcaption>Scale Object Options</tcaption>
</table>
<table>
<row>
<cell align="left" valign="middle"><em>Event</em></cell>
</row>
<row>
<cell align="left" valign="middle">{gs, Scale, click, Data, [Value | _]}</cell>
</row>
<tcaption>Scale Object Options</tcaption>
</table>
<p>The following example prompts a user to specify an RGB-value for the background color of a window.</p>
<marker id="gs_fig23"></marker>
<image file="images/ex11.gif">
<icaption>Scale Objects for Selecting RGB Values for a Window</icaption>
</image>
<codeinclude file="examples/ex11.erl" tag="" type="erl"></codeinclude>
</section>
</chapter>
|