<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cegui.org.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vknecht</id>
		<title>CEGUI Wiki - Crazy Eddie's GUI System (Open Source) - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://cegui.org.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vknecht"/>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/Special:Contributions/Vknecht"/>
		<updated>2026-04-05T15:03:35Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUIPython&amp;diff=3246</id>
		<title>CEGUIPython</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUIPython&amp;diff=3246"/>
				<updated>2009-02-07T13:35:20Z</updated>
		
		<summary type="html">&lt;p&gt;Vknecht: /* Documentation */ Fixed URL to python bindings API reference&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Cegui has a really nice set of python bindings that can be used to script your interfaces using this nice language. The python bindings where originally created for project [http://www.projectxenocide.com/ Xenocide], and its main authors are guyver6 (main developer) and reist (build system and adapting for new cegui versions).&lt;br /&gt;
&lt;br /&gt;
= Downloading =&lt;br /&gt;
&lt;br /&gt;
== Release ==&lt;br /&gt;
&lt;br /&gt;
You can get the released package for cegui 0.5:&lt;br /&gt;
[http://b2cs.delcorp.org/files/CEGUIPython-0.5.0.tar.gz CEGUIPython-0.5.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
== SVN/CVS ==&lt;br /&gt;
&lt;br /&gt;
The cegui python script module can be downloaded from cegui cvs using the following commands:&lt;br /&gt;
&lt;br /&gt;
 cvs -d:pserver:anonymous@crayzedsgui.cvs.sourceforge.net:/cvsroot/crayzedsgui login&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@crayzedsgui.cvs.sourceforge.net:/cvsroot/crayzedsgui/ co -P ceguiaddons/PythonScriptModule/ScriptingModules/CEGUIPython&lt;br /&gt;
&lt;br /&gt;
Note if you have some problem there is the Xenocide svn where ceguipython is usually first fixed, you can get it also from there by using svn tools:&lt;br /&gt;
&lt;br /&gt;
 svn co http://svn.projectxenocide.com/xenocide/trunk/cegui/ScriptingModules/CEGUIPython CEGUIPython&lt;br /&gt;
&lt;br /&gt;
Then to build and install you would go to the CEGUIPython folder, and do the following commands:&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
&lt;br /&gt;
 bash bootstrap (only needed the first time if you got the package from cvs/svn, to generate some files)&lt;br /&gt;
 ./configure&lt;br /&gt;
 make&lt;br /&gt;
 make install (you'll need root/admin privileges for this)&lt;br /&gt;
&lt;br /&gt;
Also note you might need to regenerate the bindings using swig if you need to link with a 3d party library python bindings (as all swig generated modules must be generated using the same version of swig so they can work together). &lt;br /&gt;
&lt;br /&gt;
The build system does not yet detect a different swig version, so you need to trick it to think the main interface file has changed so it will be rebuilt:&lt;br /&gt;
&lt;br /&gt;
 touch package/cegui.i&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
= Using =&lt;br /&gt;
&lt;br /&gt;
The bindings are pretty extensive and allow to access most of cegui functionality. &lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
In general the api is the same as cegui's, but all get/set methods are translated into python attributes, as illustrated in the following (simple) example:&lt;br /&gt;
&lt;br /&gt;
'''c++'''&lt;br /&gt;
&lt;br /&gt;
 float max = slider-&amp;gt;getMaxValue();&lt;br /&gt;
 slider-&amp;gt;setMaxValue(max+1);&lt;br /&gt;
&lt;br /&gt;
'''python'''&lt;br /&gt;
&lt;br /&gt;
 max = slider.MaxValue;&lt;br /&gt;
 slider.MaxValue = max+1;&lt;br /&gt;
&lt;br /&gt;
== Creating Windows ==&lt;br /&gt;
&lt;br /&gt;
As usual in cegui you create windows by using the cegui window manager:&lt;br /&gt;
&lt;br /&gt;
 slider = winMgr.createWindow(&amp;quot;ice/Slider&amp;quot;,&amp;quot;Demo7/Window/Slider9&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
== Subscribing to events ==&lt;br /&gt;
&lt;br /&gt;
You can set python functions to respond to different interface events&lt;br /&gt;
&lt;br /&gt;
 slider.subscribeEvent(cegui.Slider.EventValueChanged,onSlider)&lt;br /&gt;
&lt;br /&gt;
Then, at the event callback you get an args parameter, that will be of a different type depending on the kind of event, you can check the type by printing the object if you're not sure.&lt;br /&gt;
&lt;br /&gt;
 def onSlider(args):&lt;br /&gt;
        print args # shows in this case this is a cegui.WindowEventArgs&lt;br /&gt;
        w = args.Window&lt;br /&gt;
        val = w.CurrentValue&lt;br /&gt;
        print w.Name,&amp;quot;received&amp;quot;,val&lt;br /&gt;
&lt;br /&gt;
= Documentation =&lt;br /&gt;
&lt;br /&gt;
There is not yet proper documentation for the cegui python bindings, but there is an api reference at http://delcorp.org/~caedes/pyceguidoc (without the method descriptions yet, but can help to find out what a method name could be). Other than this for now you have to refer to the main cegui documentation.&lt;/div&gt;</summary>
		<author><name>Vknecht</name></author>	</entry>

	</feed>