<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="../../../../doc/otp_doc.css" type="text/css"> <title>Erlang -- gs</title> </head> <body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container"> <script id="js" type="text/javascript" language="JavaScript" src="../../../../doc/js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../../../../doc/js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript"> <!-- function getWinHeight() { var myHeight = 0; if( typeof( window.innerHeight ) == 'number' ) { //Non-IE myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myHeight = document.body.clientHeight; } return myHeight; } function setscrollpos() { var objf=document.getElementById('loadscrollpos'); document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2; } function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } addEvent(window, 'load', setscrollpos); //--></script><div id="leftnav"><div class="innertube"> <img alt="Erlang logo" src="../../../../doc/erlang-logo.png"><br><small><a href="users_guide.html">User's Guide</a><br><a href="index.html">Reference Manual</a><br><a href="release_notes.html">Release Notes</a><br><a href="../pdf/gs-1.5.11.pdf">PDF</a><br><a href="../../../../doc/index.html">Top</a></small><p><strong>Graphics System (GS)</strong><br><strong>Reference Manual</strong><br><small>Version 1.5.11</small></p> <br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Table of Contents</strong></small></p> <ul class="flipMenu"><li id="loadscrollpos" title="gs " expanded="true">gs<ul> <li><a href="gs.html"> Top of manual page </a></li> <li title="config-2"><a href="gs.html#config-2">config/2</a></li> <li title="create-2"><a href="gs.html#create-2">create/2</a></li> <li title="create-3"><a href="gs.html#create-3">create/3</a></li> <li title="create-4"><a href="gs.html#create-4">create/4</a></li> <li title="create_tree-2"><a href="gs.html#create_tree-2">create_tree/2</a></li> <li title="destroy-1"><a href="gs.html#destroy-1">destroy/1</a></li> <li title="ObjType-1"><a href="gs.html#ObjType-1">ObjType/1</a></li> <li title="ObjType-2"><a href="gs.html#ObjType-2">ObjType/2</a></li> <li title="ObjType-3"><a href="gs.html#ObjType-3">ObjType/3</a></li> <li title="read-2"><a href="gs.html#read-2">read/2</a></li> <li title="start-0"><a href="gs.html#start-0">start/0</a></li> <li title="stop-0"><a href="gs.html#stop-0">stop/0</a></li> </ul> </li></ul> </div></div> <div id="content"> <div class="innertube"> <!-- refpage --><center><h1>gs</h1></center> <h3>MODULE</h3> <div class="REFBODY">gs</div> <h3>MODULE SUMMARY</h3> <div class="REFBODY">The Graphics System for Erlang.</div> <h3>DESCRIPTION</h3> <div class="REFBODY"><p> <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 <span class="code">gsobj()</span> 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 <span class="code">{error,Reason}</span> 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> </p></div> <h3>EXPORTS</h3> <p><a name="config-2"><span class="bold_code">config(GSObj, Options) -> ok</span></a><br></p> <div class="REFBODY"> <p>Types:</p> <div class="REFTYPES"> <span class="bold_code">GSOBj = gsobj()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Options = [Option] | Option</span><br> </div> <div class="REFTYPES"> <span class="bold_code"> Option = {Key,Value}</span><br> </div> </div> <div class="REFBODY"><p> <p>Configures a graphical object according to the specified options.</p> </p></div> <p><a name="create-2"><span class="bold_code">create(ObjType, Parent) -> ObjId</span></a><br><a name="create-3"><span class="bold_code">create(ObjType, Parent, Options) -> ObjId</span></a><br><a name="create-4"><span class="bold_code">create(ObjType, Name, Parent, Options) -> ObjId</span></a><br></p> <div class="REFBODY"> <p>Types:</p> <div class="REFTYPES"> <span class="bold_code">ObjType = atom()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Parent = gsobj()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Name = atom()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Options = [Option] | Option</span><br> </div> <div class="REFTYPES"> <span class="bold_code"> Option = {Key,Value}</span><br> </div> </div> <div class="REFBODY"><p> <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: <span class="code">window | button | radiobutton | checkbutton | label | frame | entry | listbox | canvas | arc | image | line | oval | polygon | rectangle | text | menubar | menubutton | menu | menuitem | grid | gridline | editor | scale</span></p> </p></div> <p><a name="create_tree-2"><span class="bold_code">create_tree(Parent, Tree) -> ok</span></a><br></p> <div class="REFBODY"> <p>Types:</p> <div class="REFTYPES"> <span class="bold_code">Parent = gsobj()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Tree = [Object]</span><br> </div> <div class="REFTYPES"> <span class="bold_code"> Object = {ObjType,Options} | {ObjType,Options,Tree} | {ObjType,Name,Options,Tree}</span><br> </div> </div> <div class="REFBODY"><p> <p>Creates a hierarchy of graphical objects.</p> </p></div> <p><a name="destroy-1"><span class="bold_code">destroy(GSObj) -> void()</span></a><br></p> <div class="REFBODY"> <p>Types:</p> <div class="REFTYPES"> <span class="bold_code">GSObj = gsobj()</span><br> </div> </div> <div class="REFBODY"><p> <p>Destroys a graphical object and all its children.</p> </p></div> <p><a name="ObjType-1"><span class="bold_code">ObjType(Parent)</span></a><br><a name="ObjType-2"><span class="bold_code">ObjType(Parent, Options)</span></a><br><a name="ObjType-3"><span class="bold_code">ObjType(Name, Parent, Options)</span></a><br></p> <div class="REFBODY"><p> <p>These functions are shorthand equivalents of <span class="code">create/2</span>, <span class="code">create/3</span>, and <span class="code">create/4</span>, respectively.</p> </p></div> <p><a name="read-2"><span class="bold_code">read(GSObj, Key) -> Value</span></a><br></p> <div class="REFBODY"> <p>Types:</p> <div class="REFTYPES"> <span class="bold_code">GSObj = gsobj()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Key = atom()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Value = term()</span><br> </div> </div> <div class="REFBODY"><p> <p>Returns the value of an option key for the specified graphical object.</p> </p></div> <p><a name="start-0"><span class="bold_code">start() -> ObjId</span></a><br></p> <div class="REFBODY"><p> <p>Starts GS, unless it is already started, and returns its object identifier.</p> </p></div> <p><a name="stop-0"><span class="bold_code">stop() -> void()</span></a><br></p> <div class="REFBODY"><p> <p>Stops GS and closes all windows. This function is not the opposite of <span class="code">start/0</span> as it will cause <strong>all</strong> applications to lose their GS objects.</p> </p></div> </div> <div class="footer"> <hr> <p>Copyright © 1997-2010 Ericsson AB. All Rights Reserved.</p> </div> </div> </div></body> </html>