<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://oxeyegames.com/wiki/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://oxeyegames.com/wiki/index.php?action=history&amp;feed=atom&amp;title=CreateComponent</id>
		<title>CreateComponent - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://oxeyegames.com/wiki/index.php?action=history&amp;feed=atom&amp;title=CreateComponent"/>
		<link rel="alternate" type="text/html" href="http://oxeyegames.com/wiki/index.php?title=CreateComponent&amp;action=history"/>
		<updated>2026-04-12T03:33:53Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.0</generator>

	<entry>
		<id>http://oxeyegames.com/wiki/index.php?title=CreateComponent&amp;diff=123&amp;oldid=prev</id>
		<title>Jeb: Created page with '{{GUIMethod | gui.createComponent(componentType[, parent [, id]]) | Creates a new Lunamatic instance of a GUI element. This element will remain in memory even if the Lua ...'</title>
		<link rel="alternate" type="text/html" href="http://oxeyegames.com/wiki/index.php?title=CreateComponent&amp;diff=123&amp;oldid=prev"/>
				<updated>2009-03-09T08:33:03Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#39;{{GUIMethod | gui.createComponent(componentType[, parent [, id]]) | Creates a new &lt;a href=&quot;/wiki/index.php/Lunamatic&quot; title=&quot;Lunamatic&quot;&gt;Lunamatic&lt;/a&gt; instance of a &lt;a href=&quot;/wiki/index.php?title=GUI_element.&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;GUI element. (page does not exist)&quot;&gt;GUI element.&lt;/a&gt; This element will remain in memory even if the Lua ...&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{GUIMethod&lt;br /&gt;
|&lt;br /&gt;
gui.createComponent(componentType[, parent [, id]])&lt;br /&gt;
|&lt;br /&gt;
Creates a new [[Lunamatic]] instance of a [[GUI element.]] This element will remain in memory even if the Lua variable is lost. To remove the element for real, call the [[removeComponent]] to remove the component or the component's parent.&lt;br /&gt;
|&lt;br /&gt;
{{MethodParam|componentType|A string|Selects what component type that should be created, see below.}}&lt;br /&gt;
{{MethodParam|parent|Optional id name of parent, or the parent element|Use this parameter if the component should be placed inside another component, such as a label placed inside a window. You can leave this variable to nil if you don't want a parent.}}&lt;br /&gt;
{{MethodParam|id|Optional string|Gives the component an ID name that can be used to identify the component later.}}&lt;br /&gt;
|&lt;br /&gt;
Returns a Lunamatic reference to a GUI component, or nil if an error occurs.&lt;br /&gt;
}}&lt;br /&gt;
=== Component Types ===&lt;br /&gt;
{| border=2 cellpadding=3 cellspacing=0 style=&amp;quot;margin: 0 0 1em 1em; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#c7e0c7&amp;quot;| '''Type Name'''&lt;br /&gt;
|style=&amp;quot;background:#c7e0c7&amp;quot;| '''Description'''&lt;br /&gt;
|-&lt;br /&gt;
| label || A static text label.&lt;br /&gt;
|-&lt;br /&gt;
| button || A button, fetch clicks with the onClick callback.&lt;br /&gt;
|-&lt;br /&gt;
| checkbox || An on and off checkbox.&lt;br /&gt;
|-&lt;br /&gt;
| combobox || A selection box with a dropdown list.&lt;br /&gt;
|-&lt;br /&gt;
| editbox || A single-line edit field.&lt;br /&gt;
|-&lt;br /&gt;
| window || A frame with a border, a title bar and hide window buttons. A window can be moved around by the user.&lt;br /&gt;
|-&lt;br /&gt;
| frame || A fixed frame with a border. Frames can't be moved, closed or resized by the user.&lt;br /&gt;
|-&lt;br /&gt;
| dframe || A &amp;quot;detachable&amp;quot; frame. D-frames can be moved, hidden and resized by the user. They can also be &amp;quot;locked&amp;quot; and made transparent.&lt;br /&gt;
|-&lt;br /&gt;
| layout || Layouts are invisible frames that are used for grouping and sorting.&lt;br /&gt;
|-&lt;br /&gt;
| tabrow || A single-line group of tabular buttons. Note that tabrows does not have panels (like a tabular pane), so you will need to implement such panels yourself.&lt;br /&gt;
|-&lt;br /&gt;
| listbox || A list with a scrollbar that can contain text elements or other GUI components.&lt;br /&gt;
|-&lt;br /&gt;
| vscroll || A vertical scrollbar.&lt;br /&gt;
|-&lt;br /&gt;
| hscroll || A horizontal scrollbar.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
=== Example ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   local frame = gui.createComponent(&amp;quot;frame&amp;quot;)&lt;br /&gt;
   local text = gui.createComponent(&amp;quot;label&amp;quot;, frame)&lt;br /&gt;
&lt;br /&gt;
   text:setText(WChar(&amp;quot;Hello World!&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
   frame:sortVertically(5)&lt;br /&gt;
   frame:centerOnParent()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jeb</name></author>	</entry>

	</feed>