2000 2012 Ericsson AB, All Rights Reserved 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. gs Gunilla Hugosson
gs The Graphics System for Erlang.

GS is not recommended for use in new applications. Instead we recommend WX for applications that need a graphical user interface.

GS is deprecated and will be removed in the R16 release.

The Graphics System, GS, is easy to learn and designed to be portable to many different platforms.

In the description below, the type 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 if an error occurs.

Please refer to the GS User's Guide for a description of the different object types and possible options.

config(GSObj, Options) -> ok Configure a graphical object. GSOBj = gsobj() Options = [Option] | Option  Option = {Key,Value}

Configures a graphical object according to the specified options.

create(ObjType, Parent) -> ObjId create(ObjType, Parent, Options) -> ObjId create(ObjType, Name, Parent, Options) -> ObjId Create a new graphical object. ObjType = atom() Parent = gsobj() Name = atom() Options = [Option] | Option  Option = {Key,Value}

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.

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.

The following object types exist:

create_tree(Parent, Tree) -> ok Create a hierarchy of graphical objects. Parent = gsobj() Tree = [Object]  Object = {ObjType,Options} | {ObjType,Options,Tree} | {ObjType,Name,Options,Tree}

Creates a hierarchy of graphical objects.

destroy(GSObj) -> void() Destroy a graphical object. GSObj = gsobj()

Destroys a graphical object and all its children.

ObjType(Parent) ObjType(Parent, Options) ObjType(Name, Parent, Options) Shorthand equivalents of .

These functions are shorthand equivalents of , , and , respectively.

read(GSObj, Key) -> Value Return the value of an object option. GSObj = gsobj() Key = atom() Value = term()

Returns the value of an option key for the specified graphical object.

start() -> ObjId Start GS.

Starts GS, unless it is already started, and returns its object identifier.

stop() -> void() Stop GS.

Stops GS and closes all windows. This function is not the opposite of as it will cause all applications to lose their GS objects.