<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cegui.org.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=User%3ACrond%2Fsandbox%2FopenglEventExample2</id>
		<title>User:Crond/sandbox/openglEventExample2 - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://cegui.org.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=User%3ACrond%2Fsandbox%2FopenglEventExample2"/>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=User:Crond/sandbox/openglEventExample2&amp;action=history"/>
		<updated>2026-04-06T16:28:26Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=User:Crond/sandbox/openglEventExample2&amp;diff=4550&amp;oldid=prev</id>
		<title>Crond: /* Source */ use getText method</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=User:Crond/sandbox/openglEventExample2&amp;diff=4550&amp;oldid=prev"/>
				<updated>2011-06-20T16:01:08Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Source: &lt;/span&gt; use getText method&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 16:01, 20 June 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 248:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 248:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; # Handler: Text accepted&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; # Handler: Text accepted&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; def handlerTextAccepted(self, args):&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; def handlerTextAccepted(self, args):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; print('Text has been accepted.')&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; print('Text &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[{0}]&lt;/ins&gt;has been accepted.'&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.format(self.editboxText.getText())&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Crond</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=User:Crond/sandbox/openglEventExample2&amp;diff=4549&amp;oldid=prev</id>
		<title>Crond: /* Notes */ fix link</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=User:Crond/sandbox/openglEventExample2&amp;diff=4549&amp;oldid=prev"/>
				<updated>2011-06-20T15:55:25Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Notes: &lt;/span&gt; fix link&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 15:55, 20 June 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Notes ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Notes ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The source code uses a modified version of the OpenGL example posted [[User:Crond/sandbox/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;opengEventExample&lt;/del&gt;|here]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The source code uses a modified version of the OpenGL example posted [[User:Crond/sandbox/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;openglEventExample&lt;/ins&gt;|here]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Source ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Source ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Crond</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=User:Crond/sandbox/openglEventExample2&amp;diff=4547&amp;oldid=prev</id>
		<title>Crond: /* Requirements */ superfluous</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=User:Crond/sandbox/openglEventExample2&amp;diff=4547&amp;oldid=prev"/>
				<updated>2011-06-20T15:52:08Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Requirements: &lt;/span&gt; superfluous&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 15:52, 20 June 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Requirements ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Requirements ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Python 2.6 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(untested on Python 3.+)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Python 2.6&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* PyCEGUI&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* PyCEGUI&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* PyOpenGL &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(GLU and GLUT, as well)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* PyOpenGL&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Notes ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Notes ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Crond</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=User:Crond/sandbox/openglEventExample2&amp;diff=4531&amp;oldid=prev</id>
		<title>Crond: Created page with &quot;{{VersionBadge|0.7}} {{VersionAtLeast|0.7.5}} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  == Introduction == This presents a slightly refined example of using subscriptions to respond to events. T...&quot;</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=User:Crond/sandbox/openglEventExample2&amp;diff=4531&amp;oldid=prev"/>
				<updated>2011-06-18T21:34:12Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{VersionBadge|0.7}} {{VersionAtLeast|0.7.5}} &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;  == Introduction == This presents a slightly refined example of using subscriptions to respond to events. T...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{VersionBadge|0.7}} {{VersionAtLeast|0.7.5}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This presents a slightly refined example of using subscriptions to respond to events. The example will generate some text on the console when an Editbox receives input, and when Enter/Return is pressed while the Editbox has focus.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* Python 2.6 (untested on Python 3.+)&lt;br /&gt;
* PyCEGUI&lt;br /&gt;
* PyOpenGL (GLU and GLUT, as well)&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
The source code uses a modified version of the OpenGL example posted [[User:Crond/sandbox/opengEventExample|here]].&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
# example.py&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Import: std&lt;br /&gt;
import sys&lt;br /&gt;
&lt;br /&gt;
# Import: PyOpenGL&lt;br /&gt;
from OpenGL.GL import *&lt;br /&gt;
from OpenGL.GLU import *&lt;br /&gt;
from OpenGL.GLUT import *&lt;br /&gt;
&lt;br /&gt;
# Import: PyCEGUI&lt;br /&gt;
import PyCEGUI&lt;br /&gt;
from PyCEGUIOpenGLRenderer import OpenGLRenderer as Renderer&lt;br /&gt;
&lt;br /&gt;
# Constants&lt;br /&gt;
PATH_RESOURCES = './'&lt;br /&gt;
&lt;br /&gt;
# Keymap: ASCII&lt;br /&gt;
KEYMAP_ASCII = {8 : PyCEGUI.Key.Scan.Backspace,&lt;br /&gt;
                13 : PyCEGUI.Key.Scan.Return,&lt;br /&gt;
                27 : PyCEGUI.Key.Scan.Escape,&lt;br /&gt;
                127 : PyCEGUI.Key.Scan.Delete}&lt;br /&gt;
&lt;br /&gt;
# Keymap: GLUT&lt;br /&gt;
KEYMAP_GLUT = {GLUT_KEY_LEFT : PyCEGUI.Key.Scan.ArrowLeft,&lt;br /&gt;
               GLUT_KEY_RIGHT : PyCEGUI.Key.Scan.ArrowRight,&lt;br /&gt;
               GLUT_KEY_HOME : PyCEGUI.Key.Scan.Home,&lt;br /&gt;
               GLUT_KEY_END : PyCEGUI.Key.Scan.End}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Application&lt;br /&gt;
class Application(object):&lt;br /&gt;
&lt;br /&gt;
    # Constructor&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        super(Application, self).__init__()&lt;br /&gt;
        self.lastFrameTime = 0&lt;br /&gt;
        self.updateFPS = 0&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Initialize: OpenGL&lt;br /&gt;
    # - A full list of values for `glutInitDisplayMode` can be found in the GLUT&lt;br /&gt;
    #   documentation.&lt;br /&gt;
    def initializeOpenGL(self):&lt;br /&gt;
        glutInit()&lt;br /&gt;
        glutDestroyWindow(glutCreateWindow(''))&lt;br /&gt;
        glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA)&lt;br /&gt;
        glutInitWindowSize(1024, 768)&lt;br /&gt;
        glutInitWindowPosition(-1, -1) # Let the windowing system figure it out&lt;br /&gt;
        glutCreateWindow(&amp;quot;Crazy Eddie's GUI Mk-2 - glut Base Application&amp;quot;)&lt;br /&gt;
        glutSetCursor(GLUT_CURSOR_NONE)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Initialize: Handlers&lt;br /&gt;
    # - Setup the methods which will be called when events happen.&lt;br /&gt;
    def initializeHandlers(self):&lt;br /&gt;
        glutDisplayFunc(self.handlerDisplay)&lt;br /&gt;
        glutReshapeFunc(self.handlerResize)&lt;br /&gt;
        glutKeyboardFunc(self.handlerKeyboard)&lt;br /&gt;
        glutSpecialFunc(self.handlerKeyboardSpecial)&lt;br /&gt;
        glutMouseFunc(self.handlerMouse)&lt;br /&gt;
        glutMotionFunc(self.handlerMouseMotion)&lt;br /&gt;
        glutPassiveMotionFunc(self.handlerMouseMotion)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Initialize: PyCEGUI&lt;br /&gt;
    # - Store some components; saves a lot of typing.&lt;br /&gt;
    def initializePyCEGUI(self):&lt;br /&gt;
        Renderer.bootstrapSystem()&lt;br /&gt;
        self.sys = PyCEGUI.System.getSingleton()&lt;br /&gt;
        self.rp = self.sys.getResourceProvider()&lt;br /&gt;
        self.scheme = PyCEGUI.SchemeManager.getSingleton()&lt;br /&gt;
        self.wm = PyCEGUI.WindowManager.getSingleton()&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Initialize: Defaults&lt;br /&gt;
    # - Resource locations.&lt;br /&gt;
    def initializeDefaults(self):&lt;br /&gt;
        self.rp.setResourceGroupDirectory('schemes', './datafiles/schemes')&lt;br /&gt;
        self.rp.setResourceGroupDirectory('imagesets', './datafiles/imagesets')&lt;br /&gt;
        self.rp.setResourceGroupDirectory('fonts', './datafiles/fonts')&lt;br /&gt;
        self.rp.setResourceGroupDirectory('layouts', './datafiles/layouts')&lt;br /&gt;
        self.rp.setResourceGroupDirectory('looknfeels', './datafiles/looknfeel')&lt;br /&gt;
        self.rp.setResourceGroupDirectory('schemas', './datafiles/xml_schemas')&lt;br /&gt;
        PyCEGUI.Imageset.setDefaultResourceGroup('imagesets')&lt;br /&gt;
        PyCEGUI.Font.setDefaultResourceGroup('fonts')&lt;br /&gt;
        PyCEGUI.Scheme.setDefaultResourceGroup('schemes')&lt;br /&gt;
        PyCEGUI.WidgetLookManager.setDefaultResourceGroup('looknfeels')&lt;br /&gt;
        PyCEGUI.WindowManager.setDefaultResourceGroup('layouts')&lt;br /&gt;
        parser = self.sys.getXMLParser()&lt;br /&gt;
        if parser.isPropertyPresent('SchemaDefaultResourceGroup'):&lt;br /&gt;
            parser.setProperty('SchemaDefaultResourceGroup', 'schemas')&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Initialize: GUI&lt;br /&gt;
    # - This is where we are actually setting up the windows we will see.&lt;br /&gt;
    def initializeGUI(self):&lt;br /&gt;
        self.scheme.create('VanillaSkin.scheme')&lt;br /&gt;
        self.scheme.create('TaharezLook.scheme')&lt;br /&gt;
&lt;br /&gt;
        # GUISheet&lt;br /&gt;
        self.rootWindow = self.wm.loadWindowLayout('VanillaWindows.layout')&lt;br /&gt;
        self.sys.setGUISheet(self.rootWindow)&lt;br /&gt;
&lt;br /&gt;
        # Cursor&lt;br /&gt;
        self.sys.setDefaultMouseCursor('Vanilla-Images', 'MouseArrow')&lt;br /&gt;
&lt;br /&gt;
        # An extra window&lt;br /&gt;
        w = self.wm.createWindow('TaharezLook/FrameWindow', 'Demo window')&lt;br /&gt;
        self.rootWindow.addChildWindow(w)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Initialize: Subscriptions&lt;br /&gt;
    def initializeSubscriptions(self):&lt;br /&gt;
&lt;br /&gt;
        # In order to be able to access the buttons, we need to get a copy of their parent.&lt;br /&gt;
        self.windowNewNode = self.rootWindow.getChild('Demo/NewNode')&lt;br /&gt;
&lt;br /&gt;
        # Now, we get the buttons.&lt;br /&gt;
        self.buttonOkay = self.windowNewNode.getChild('Demo/NewNode/Okay')&lt;br /&gt;
        self.buttonCancel = self.windowNewNode.getChild('Demo/NewNode/Cancel')&lt;br /&gt;
        self.editboxText = self.windowNewNode.getChild('Demo/NewNode/Editbox')&lt;br /&gt;
&lt;br /&gt;
        # And subscribe to the events, telling PyCEGUI what method it should call when the event happens.&lt;br /&gt;
        self.buttonOkay.subscribeEvent(PyCEGUI.PushButton.EventClicked, self, 'buttonOkayClicked')&lt;br /&gt;
        self.buttonCancel.subscribeEvent(PyCEGUI.PushButton.EventClicked, self, 'buttonCancelClicked')&lt;br /&gt;
        self.editboxText.subscribeEvent(PyCEGUI.Editbox.EventTextChanged, self, 'handlerTextChanged')&lt;br /&gt;
        self.editboxText.subscribeEvent(PyCEGUI.Editbox.EventTextAccepted, self, 'handlerTextAccepted')&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Initialize&lt;br /&gt;
    def Initialize(self):&lt;br /&gt;
        self.initializeOpenGL()&lt;br /&gt;
        self.initializeHandlers()&lt;br /&gt;
        self.initializePyCEGUI()&lt;br /&gt;
        self.initializeDefaults()&lt;br /&gt;
        self.initializeGUI()&lt;br /&gt;
        self.initializeSubscriptions()&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Handler: Display&lt;br /&gt;
    def handlerDisplay(self):&lt;br /&gt;
&lt;br /&gt;
        # Injecting the time allows CEGUI to know how much time has passed, and&lt;br /&gt;
        # use that to coordinate certain activities - fading, animation, tooltips,&lt;br /&gt;
        # etc.&lt;br /&gt;
        now = glutGet(GLUT_ELAPSED_TIME)&lt;br /&gt;
        elapsed = (now - self.lastFrameTime) / 1000.0&lt;br /&gt;
        self.lastFrameTime = now&lt;br /&gt;
        self.updateFPS = self.updateFPS - elapsed&lt;br /&gt;
        self.sys.injectTimePulse(elapsed)&lt;br /&gt;
&lt;br /&gt;
        # Actual rendering&lt;br /&gt;
        # - `renderGUI` updates CEGUI's picture of the GUI.&lt;br /&gt;
        # - `glutPostRedisplay` is what actually marks the window as needing to&lt;br /&gt;
        #   be redrawn by OpenGL.&lt;br /&gt;
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)&lt;br /&gt;
        self.sys.renderGUI()&lt;br /&gt;
        glutPostRedisplay()&lt;br /&gt;
        glutSwapBuffers()&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Handler: Resize&lt;br /&gt;
    # - `glViewport` modifies the OpenGL viewport to whatever the window size is.&lt;br /&gt;
    def handlerResize(self, width, height):&lt;br /&gt;
        glViewport(0, 0, width, height)&lt;br /&gt;
        self.sys.notifyDisplaySizeChanged(PyCEGUI.Size(width, height))&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Handler: Assist keyboard&lt;br /&gt;
    def handlerAssistKeyboard(self, key):&lt;br /&gt;
        try:&lt;br /&gt;
            self.sys.injectKeyDown(KEYMAP_ASCII[key])&lt;br /&gt;
        except KeyError:&lt;br /&gt;
            return False&lt;br /&gt;
        return True&lt;br /&gt;
&lt;br /&gt;
    # Handler: Keyboard&lt;br /&gt;
    def handlerKeyboard(self, key, x, y):&lt;br /&gt;
        k = ord(key)&lt;br /&gt;
        if not self.handlerAssistKeyboard(k):&lt;br /&gt;
            self.sys.injectChar(ord(key))&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Handler: Keyboard special&lt;br /&gt;
    def handlerKeyboardSpecial(self, key, x, y):&lt;br /&gt;
        try:&lt;br /&gt;
            self.sys.injectKeyDown(KEYMAP_GLUT[key])&lt;br /&gt;
        except KeyError:&lt;br /&gt;
            # Ignore it.&lt;br /&gt;
            pass&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Handler: Mouse buttons&lt;br /&gt;
    def handlerMouse(self, button, state, x, y):&lt;br /&gt;
        if button == GLUT_LEFT_BUTTON:&lt;br /&gt;
            if state == GLUT_UP:&lt;br /&gt;
                self.sys.injectMouseButtonUp(PyCEGUI.LeftButton)&lt;br /&gt;
            else:&lt;br /&gt;
                self.sys.injectMouseButtonDown(PyCEGUI.LeftButton)&lt;br /&gt;
        elif button == GLUT_RIGHT_BUTTON:&lt;br /&gt;
            if state == GLUT_UP:&lt;br /&gt;
                self.sys.injectMouseButtonUp(PyCEGUI.RightButton)&lt;br /&gt;
            else:&lt;br /&gt;
                self.sys.injectMouseButtonDown(PyCEGUI.RightButton)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Handler: Mouse motion&lt;br /&gt;
    def handlerMouseMotion(self, x, y):&lt;br /&gt;
        self.sys.injectMousePosition(x, y)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Handler: buttonOkayClicked&lt;br /&gt;
    def buttonOkayClicked(self, args):&lt;br /&gt;
        print('Okay has been clicked.')&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Handler: buttonCancelClicked&lt;br /&gt;
    def buttonCancelClicked(self, args):&lt;br /&gt;
        print('Cancel has been clicked.')&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Handler: Text changed&lt;br /&gt;
    def handlerTextChanged(self, args):&lt;br /&gt;
        print('Text has changed.')&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Handler: Text accepted&lt;br /&gt;
    def handlerTextAccepted(self, args):&lt;br /&gt;
        print('Text has been accepted.')&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    # Run&lt;br /&gt;
    def Run(self):&lt;br /&gt;
        self.lastFrameTime = glutGet(GLUT_ELAPSED_TIME)&lt;br /&gt;
        glutMainLoop()&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
# Main&lt;br /&gt;
def main():&lt;br /&gt;
    app = Application()&lt;br /&gt;
    app.Initialize()&lt;br /&gt;
    app.Run()&lt;br /&gt;
    return 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Guard&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    sys.exit(main())&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demonstration ==&lt;br /&gt;
Enter some text into the Editbox, and/or press Return while the Editbox has focus.&lt;br /&gt;
&lt;br /&gt;
== Examination ==&lt;br /&gt;
In the context of the previous examples, this is all pretty straightforward; this simply demonstrates some additional events which are relevant to an Editbox.&lt;br /&gt;
&lt;br /&gt;
As an exercise for the reader, consider the implications of removing the mapping of the return key from `KEYMAP_ASCII`, and why the effects are what they are.&lt;/div&gt;</summary>
		<author><name>Crond</name></author>	</entry>

	</feed>