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
|
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
<year>2000</year>
<year>2014</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.
The Initial Developer of the Original Code is Ericsson AB.
</legalnotice>
<title>gs</title>
<prepared>Gunilla Hugosson</prepared>
<docno></docno>
<date></date>
<rev></rev>
</header>
<module>gs</module>
<modulesummary>The Graphics System for Erlang.</modulesummary>
<description>
<warning>
<p>
GS is not recommended for use in new applications.
Instead we recommend WX for applications that need a
graphical user interface.
</p>
<p>
GS is deprecated and will be removed in the 18.0 release.
</p>
</warning>
<p>The Graphics System, GS, is easy to learn and
designed to be portable to many different platforms.</p>
<p>In the description below, the type <c><![CDATA[gsobj()]]></c> denotes a
reference to a graphical object created with GS. Such a reference
is either a GS object identifier or the name of the object (an atom),
if such a name exists.
The functions all return the specified values or <c><![CDATA[{error,Reason}]]></c>
if an error occurs.</p>
<p>Please refer to the GS User's Guide for a description of
the different object types and possible options.</p>
</description>
<funcs>
<func>
<name>config(GSObj, Options) -> ok</name>
<fsummary>Configure a graphical object.</fsummary>
<type>
<v>GSOBj = gsobj()</v>
<v>Options = [Option] | Option</v>
<v> Option = {Key,Value}</v>
</type>
<desc>
<p>Configures a graphical object according to the specified
options.</p>
</desc>
</func>
<func>
<name>create(ObjType, Parent) -> ObjId</name>
<name>create(ObjType, Parent, Options) -> ObjId</name>
<name>create(ObjType, Name, Parent, Options) -> ObjId</name>
<fsummary>Create a new graphical object.</fsummary>
<type>
<v>ObjType = atom()</v>
<v>Parent = gsobj()</v>
<v>Name = atom()</v>
<v>Options = [Option] | Option</v>
<v> Option = {Key,Value}</v>
</type>
<desc>
<p>Creates a new graphical object of the specified type as a child
to the specified parent object. The object is configured according
to the options and its identifier is returned. If no options
are provided, default option values are used.</p>
<p>If a name is provided, this name can be used to reference
the object instead of the object identifier. The name is local
to the process which creates the object.</p>
<p>The following object types exist: <c><![CDATA[window | button | radiobutton | checkbutton | label | frame | entry | listbox | canvas | arc | image | line | oval | polygon | rectangle | text | menubar | menubutton | menu | menuitem | grid | gridline | editor | scale]]></c></p>
</desc>
</func>
<func>
<name>create_tree(Parent, Tree) -> ok</name>
<fsummary>Create a hierarchy of graphical objects.</fsummary>
<type>
<v>Parent = gsobj()</v>
<v>Tree = [Object]</v>
<v> Object = {ObjType,Options} | {ObjType,Options,Tree} | {ObjType,Name,Options,Tree}</v>
</type>
<desc>
<p>Creates a hierarchy of graphical objects.</p>
</desc>
</func>
<func>
<name>destroy(GSObj) -> void()</name>
<fsummary>Destroy a graphical object.</fsummary>
<type>
<v>GSObj = gsobj()</v>
</type>
<desc>
<p>Destroys a graphical object and all its children.</p>
</desc>
</func>
<func>
<name>ObjType(Parent)</name>
<name>ObjType(Parent, Options)</name>
<name>ObjType(Name, Parent, Options)</name>
<fsummary>Shorthand equivalents of <c><![CDATA[create]]></c>.</fsummary>
<desc>
<p>These functions are shorthand equivalents of <c><![CDATA[create/2]]></c>,
<c><![CDATA[create/3]]></c>, and <c><![CDATA[create/4]]></c>, respectively.</p>
</desc>
</func>
<func>
<name>read(GSObj, Key) -> Value</name>
<fsummary>Return the value of an object option.</fsummary>
<type>
<v>GSObj = gsobj()</v>
<v>Key = atom()</v>
<v>Value = term()</v>
</type>
<desc>
<p>Returns the value of an option key for the specified graphical
object.</p>
</desc>
</func>
<func>
<name>start() -> ObjId</name>
<fsummary>Start GS.</fsummary>
<desc>
<p>Starts GS, unless it is already started, and returns its object
identifier.</p>
</desc>
</func>
<func>
<name>stop() -> void()</name>
<fsummary>Stop GS.</fsummary>
<desc>
<p>Stops GS and closes all windows. This function is not the opposite
of <c><![CDATA[start/0]]></c> as it will cause <em>all</em> applications
to lose their GS objects.</p>
</desc>
</func>
</funcs>
</erlref>
|