<?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=Ldb</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=Ldb"/>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/Special:Contributions/Ldb"/>
		<updated>2026-04-09T09:38:50Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2559</id>
		<title>Identifying Multiple Event Sources From A Single Callback</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2559"/>
				<updated>2007-04-09T18:39:16Z</updated>
		
		<summary type="html">&lt;p&gt;Ldb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you would like to identify the sender of an event from within your callback function.  For example, you would like to execute some common code for your buttons, like triggering a sound to be played on CEGUI::PushButton::EventClicked.  Here is an example [http://www.cegui.org.uk/api_reference/classCEGUI_1_1PushButton.html CEGUI::PushButton] we would like to wire up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
CEGUI::PushButton* pushButton = &lt;br /&gt;
  static_cast&amp;lt;CEGUI::PushButton*&amp;gt;&lt;br /&gt;
    (CEGUI::WindowManager::getSingleton().createWindow(&amp;quot;WindowsLook/Button&amp;quot;, &amp;quot;TheButton&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(CEGUI::PushButton::EventClicked,&lt;br /&gt;
                           CEGUI::Event::Subscriber(&amp;amp;MainMenu::OnButtonClick, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To do this, simply cast the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1EventArgs.html CEGUI::EventArgs] in your callback to a [http://www.cegui.org.uk/api_reference/classCEGUI_1_1WindowEventArgs.html CEGUI::WindowEventArgs]. The CEGUI::WindowEventArgs object contains a pointer to the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1Window.html CEGUI::Window] that sent the event.  Now its as easy as calling CEGUI::Window::getName().  Obviously, you can do much more now that you have a pointer to the window who fired the event, but this is just an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool MainMenu::OnButtonClick(const CEGUI::EventArgs&amp;amp; e)&lt;br /&gt;
{&lt;br /&gt;
  const CEGUI::WindowEventArgs&amp;amp; we = &lt;br /&gt;
    static_cast&amp;lt;const CEGUI::WindowEventArgs&amp;amp;&amp;gt;(e);&lt;br /&gt;
&lt;br /&gt;
  CEGUI::String senderID = we.window-&amp;gt;getName();&lt;br /&gt;
&lt;br /&gt;
  if (senderID == &amp;quot;TheButton&amp;quot;)&lt;br /&gt;
  {&lt;br /&gt;
    // code for dealing with a &amp;quot;TheButton&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ldb</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2558</id>
		<title>Identifying Multiple Event Sources From A Single Callback</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2558"/>
				<updated>2007-04-09T18:35:04Z</updated>
		
		<summary type="html">&lt;p&gt;Ldb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you would like to identify the sender of an event from within your callback function.  For example, you would like to execute some common code for your buttons, like triggering a sound to be played on CEGUI::PushButton::EventClicked.  Here is an example [http://www.cegui.org.uk/api_reference/classCEGUI_1_1PushButton.html CEGUI::PushButton] we would like to wire up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
CEGUI::PushButton* pushButton = &lt;br /&gt;
    static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingleton().createWindow(&amp;quot;WindowsLook/Button&amp;quot;, &amp;quot;TheButton&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(CEGUI::PushButton::EventClicked,&lt;br /&gt;
                       CEGUI::Event::Subscriber(&amp;amp;MainMenu::OnButtonClick, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To do this, simply cast the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1EventArgs.html CEGUI::EventArgs] in your callback to a [http://www.cegui.org.uk/api_reference/classCEGUI_1_1WindowEventArgs.html CEGUI::WindowEventArgs]. The CEGUI::WindowEventArgs object contains a pointer to the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1Window.html CEGUI::Window] that sent the event.  Now its as easy as calling CEGUI::Window::getName().  Obviously, you can do much more now that you have a pointer to the window who fired the event, but this is just an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool MainMenu::OnButtonClick(const CEGUI::EventArgs&amp;amp; e)&lt;br /&gt;
{&lt;br /&gt;
	const CEGUI::WindowEventArgs&amp;amp; we = static_cast&amp;lt;const CEGUI::WindowEventArgs&amp;amp;&amp;gt;(e);&lt;br /&gt;
	CEGUI::String senderID = we.window-&amp;gt;getName();&lt;br /&gt;
&lt;br /&gt;
	if (senderID == &amp;quot;TheButton&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // code for dealing with a &amp;quot;TheButton&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ldb</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2557</id>
		<title>Identifying Multiple Event Sources From A Single Callback</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2557"/>
				<updated>2007-04-09T18:33:19Z</updated>
		
		<summary type="html">&lt;p&gt;Ldb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you would like to identify the sender of an event from within your callback function.  For example, you would like to execute some common code for your buttons, like triggering a sound to be played on CEGUI::PushButton::EventClicked.  Here is an example [http://www.cegui.org.uk/api_reference/classCEGUI_1_1PushButton.html CEGUI::PushButton] we would like to wire up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
CEGUI::PushButton* pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingleton().createWindow(&amp;quot;WindowsLook/Button&amp;quot;, &amp;quot;TheButton&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(CEGUI::PushButton::EventClicked,&lt;br /&gt;
                       CEGUI::Event::Subscriber(&amp;amp;MainMenu::OnButtonClick, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To do this, simply cast the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1EventArgs.html CEGUI::EventArgs] in your callback to a [http://www.cegui.org.uk/api_reference/classCEGUI_1_1WindowEventArgs.html CEGUI::WindowEventArgs]. The CEGUI::WindowEventArgs object contains a pointer to the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1Window.html CEGUI::Window] that sent the event.  Now its as easy as calling CEGUI::Window::getName().  Obviously, you can do much more now that you have a pointer to the window who fired the event, but this is just an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool MainMenu::OnButtonClick(const CEGUI::EventArgs&amp;amp; e)&lt;br /&gt;
{&lt;br /&gt;
	const CEGUI::WindowEventArgs&amp;amp; we = static_cast&amp;lt;const CEGUI::WindowEventArgs&amp;amp;&amp;gt;(e);&lt;br /&gt;
	CEGUI::String senderID = we.window-&amp;gt;getName();&lt;br /&gt;
&lt;br /&gt;
	if (senderID == &amp;quot;TheButton&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // code for dealing with a &amp;quot;TheButton&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ldb</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2556</id>
		<title>Identifying Multiple Event Sources From A Single Callback</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2556"/>
				<updated>2007-04-09T17:35:07Z</updated>
		
		<summary type="html">&lt;p&gt;Ldb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you would like to identify the sender of an event from within your callback function.  For example, you would like to execute some common code for your buttons, like triggering a sound to be played on CEGUI::PushButton::EventClicked.  Here is an example [http://www.cegui.org.uk/api_reference/classCEGUI_1_1PushButton.html CEGUI::PushButton] we would like to wire up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
CEGUI::PushButton* button;&lt;br /&gt;
button-&amp;gt;subscribeEvent(CEGUI::PushButton::EventClicked,&lt;br /&gt;
                       CEGUI::Event::Subscriber(&amp;amp;MainMenu::OnButtonClick, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To do this, simply cast the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1EventArgs.html CEGUI::EventArgs] in your callback to a [http://www.cegui.org.uk/api_reference/classCEGUI_1_1WindowEventArgs.html CEGUI::WindowEventArgs]. The CEGUI::WindowEventArgs object contains a pointer to the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1Window.html CEGUI::Window] that sent the event.  Now its as easy as calling CEGUI::Window::getName().  Obviously, you can do much more now that you have a pointer to the window who fired the event, but this is just an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool MainMenu::OnButtonClick(const CEGUI::EventArgs&amp;amp; e)&lt;br /&gt;
{&lt;br /&gt;
	const CEGUI::WindowEventArgs&amp;amp; we = (const CEGUI::WindowEventArgs&amp;amp;)e;&lt;br /&gt;
	CEGUI::String senderID = we.window-&amp;gt;getName();&lt;br /&gt;
&lt;br /&gt;
	if (senderID == &amp;quot;QuitButton&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // code for dealing with a &amp;quot;QuitButton&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ldb</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2555</id>
		<title>Identifying Multiple Event Sources From A Single Callback</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2555"/>
				<updated>2007-04-09T17:28:02Z</updated>
		
		<summary type="html">&lt;p&gt;Ldb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you would like to identify the sender of an event from within your callback function.  For example, you would like to execute some common code for your buttons, like triggering a sound to be played on CEGUI::PushButton::EventClicked.  Here is an example [http://www.cegui.org.uk/api_reference/classCEGUI_1_1PushButton.html CEGUI::PushButton] we would like to wire up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
CEGUI::PushButton* button;&lt;br /&gt;
button-&amp;gt;subscribeEvent(CEGUI::PushButton::EventClicked,&lt;br /&gt;
                       CEGUI::Event::Subscriber(&amp;amp;MainMenu::OnButtonClick, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To do this, simply cast the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1EventArgs.html CEGUI::EventArgs] in your callback to a [http://www.cegui.org.uk/api_reference/classCEGUI_1_1WindowEventArgs.html CEGUI::WindowEventArgs]. The [http://www.cegui.org.uk/api_reference/classCEGUI_1_1WindowEventArgs.html CEGUI::WindowEventArgs] object contains a pointer to the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1Window.html CEGUI::Window] that sent the event.  Now its as easy as calling CEGUI::Window::getName().  Obviously, you can do much more now that you have a pointer to the window who fired the event, but this is just an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool MainMenu::OnButtonClick(const CEGUI::EventArgs&amp;amp; e)&lt;br /&gt;
{&lt;br /&gt;
	const CEGUI::WindowEventArgs&amp;amp; we = (const CEGUI::WindowEventArgs&amp;amp;)e;&lt;br /&gt;
	CEGUI::String senderID = we.window-&amp;gt;getName();&lt;br /&gt;
&lt;br /&gt;
	if (senderID == &amp;quot;QuitButton&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // code for dealing with a &amp;quot;QuitButton&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ldb</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2554</id>
		<title>Identifying Multiple Event Sources From A Single Callback</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2554"/>
				<updated>2007-04-09T17:26:52Z</updated>
		
		<summary type="html">&lt;p&gt;Ldb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you would like to identify the sender of an event from within your callback function.  For example, you would like to execute some common code for your buttons, like triggering a sound to be played on CEGUI::PushButton::EventClicked.  Here is an example [http://www.cegui.org.uk/api_reference/classCEGUI_1_1PushButton.html CEGUI::PushButton] we would like to wire up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
CEGUI::PushButton* button;&lt;br /&gt;
button-&amp;gt;subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&amp;amp;MainMenu::OnButtonClick, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To do this, simply cast the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1EventArgs.html CEGUI::EventArgs] in your callback to a [http://www.cegui.org.uk/api_reference/classCEGUI_1_1WindowEventArgs.html CEGUI::WindowEventArgs]. The [http://www.cegui.org.uk/api_reference/classCEGUI_1_1WindowEventArgs.html CEGUI::WindowEventArgs] object contains a pointer to the [http://www.cegui.org.uk/api_reference/classCEGUI_1_1Window.html CEGUI::Window] that sent the event.  Now its as easy as calling CEGUI::Window::getName().  Obviously, you can do much more now that you have a pointer to the window who fired the event, but this is just an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool MainMenu::OnButtonClick(const CEGUI::EventArgs&amp;amp; e)&lt;br /&gt;
{&lt;br /&gt;
	const CEGUI::WindowEventArgs&amp;amp; we = (const CEGUI::WindowEventArgs&amp;amp;)e;&lt;br /&gt;
	CEGUI::String senderID = we.window-&amp;gt;getName();&lt;br /&gt;
&lt;br /&gt;
	if (senderID == &amp;quot;QuitButton&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // code for dealing with a &amp;quot;QuitButton&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ldb</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2553</id>
		<title>Identifying Multiple Event Sources From A Single Callback</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2553"/>
				<updated>2007-04-09T17:01:58Z</updated>
		
		<summary type="html">&lt;p&gt;Ldb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you would like to identify the sender of an event from within your callback function.  For example, you would like to execute some common code for your buttons, like triggering a sound to be played on CEGUI::PushButton::EventClicked.  Here is an example CEGUI::PushButton we would like to wire up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CEGUI::PushButton* button;&lt;br /&gt;
button-&amp;gt;subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&amp;amp;MainMenu::OnButtonClick, this));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To do this, simply cast the CEGUI::EventArgs in your callback to a CEGUI::WindowEventArgs. The CEGUI::WindowEventArgs object contains a pointer to the window that sent the event.  Now its as easy as calling CEGUI::Window::getName().  Obviously, you can do much more now that you have a pointer to the window who fired the event, but this is just an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool MainMenu::OnButtonClick(const CEGUI::EventArgs&amp;amp; e)&lt;br /&gt;
{&lt;br /&gt;
	const CEGUI::WindowEventArgs&amp;amp; we = (const CEGUI::WindowEventArgs&amp;amp;)e;&lt;br /&gt;
	std::string senderID = we.window-&amp;gt;getName().c_str();&lt;br /&gt;
&lt;br /&gt;
	if (senderID == &amp;quot;QuitButton&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // code for dealing with a &amp;quot;QuitButton&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ldb</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2552</id>
		<title>Identifying Multiple Event Sources From A Single Callback</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2552"/>
				<updated>2007-04-09T16:58:18Z</updated>
		
		<summary type="html">&lt;p&gt;Ldb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you would like to identify the sender of an event from within your callback function.  For example, you would like to execute some common code for your buttons, like triggering a sound to be played on CEGUI::PushButton::EventClicked.  Here is an example CEGUI::PushButton we would like to wire up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CEGUI::PushButton* button;&lt;br /&gt;
button-&amp;gt;subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&amp;amp;MainMenu::OnButtonClick, this));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To do this, simply cast the CEGUI::EventArgs in your callback to a CEGUI::WindowEventArgs. The CEGUI::WindowEventArgs object contains a pointer to the window that sent the event.  Now its as easy as calling CEGUI::Window::getName().  Obviously, you can do much more now that you have a pointer to the window who fired the event, but this is just an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool MainMenu::OnButtonClick(const CEGUI::EventArgs&amp;amp; e)&lt;br /&gt;
{&lt;br /&gt;
	const CEGUI::WindowEventArgs&amp;amp; we = (const CEGUI::WindowEventArgs&amp;amp;)e;&lt;br /&gt;
	std::string senderID = we.window-&amp;gt;getName().c_str();&lt;br /&gt;
&lt;br /&gt;
	if (senderID == &amp;quot;QuitButton&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // code for dealing with a &amp;quot;QuitButton&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ldb</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2551</id>
		<title>Identifying Multiple Event Sources From A Single Callback</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Identifying_Multiple_Event_Sources_From_A_Single_Callback&amp;diff=2551"/>
				<updated>2007-04-09T16:56:24Z</updated>
		
		<summary type="html">&lt;p&gt;Ldb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you would like to identify the sender of an event from within your callback function.  For example, you would like to execute some common code for your buttons, like triggering a sound to be played on CEGUI::PushButton::EventClicked.  Here is an example CEGUI::PushButton we would like to wire up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CEGUI::PushButton* button;&lt;br /&gt;
button-&amp;gt;subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&amp;amp;MainMenu::OnButtonClick, this));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To do this, simply cast the CEGUI::EventArgs in your callback to a CEGUI::WindowEventArgs. The CEGUI::WindowEventArgs object contains a pointer to the window that sent the event.  Now its as easy as calling CEGUI::Window::getName().  Obviously, you can do much more now that you have a pointer to the window who fired the event, but this is just an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool MainMenu::OnButtonClick(const CEGUI::EventArgs&amp;amp; e)&lt;br /&gt;
{&lt;br /&gt;
	using namespace CEGUI;&lt;br /&gt;
&lt;br /&gt;
	const CEGUI::WindowEventArgs&amp;amp; we = (const CEGUI::WindowEventArgs&amp;amp;)e;&lt;br /&gt;
	std::string senderID = we.window-&amp;gt;getName().c_str();&lt;br /&gt;
&lt;br /&gt;
	if (senderID == &amp;quot;QuitButton&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // code for dealing with a &amp;quot;QuitButton&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ldb</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Tutorials&amp;diff=2550</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Tutorials&amp;diff=2550"/>
				<updated>2007-04-09T16:33:05Z</updated>
		
		<summary type="html">&lt;p&gt;Ldb: /* Miscellaneous HOW-TOs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== CrazyEddie's Beginner Guides ===&lt;br /&gt;
* [[The Beginner Guide to Getting CEGUI Rendering]] - How to initialise CEGUI to render properly.&lt;br /&gt;
* [[The Beginner Guide to Loading Data Files and Initialisation]] - How to load some data files and perform basic system initialisation.&lt;br /&gt;
* [[The Beginner Guide to Creating a CEGUI Window]] - How to create a simple window and get it on screen.&lt;br /&gt;
* [[The Beginner Guide to Injecting Inputs]] - How to inject inputs into CEGUI and get interactive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scripting with CEGUI ===&lt;br /&gt;
* [[Getting Started with Lua and CEGUI]] - How to initialise CEGUI with a Lua script module and configuration file.&lt;br /&gt;
* [[Handling Events from Lua]] - How to load Lua script files and bind CEGUI events to Lua functions.&lt;br /&gt;
* [[Writing CEGUI scripts]] - Code snippets&lt;br /&gt;
* [[Adding LuaScriptModule to Sample_FirstWindow]] - Experience adding scripting to an existing sample.&lt;br /&gt;
* [http://www.gpwiki.org/index.php/Crazy_Eddies_GUI_System:Tutorials:Creating_a_scriptable_interface_using_CEGUI Creating a scriptable interface using CEGUI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window System Examples ===&lt;br /&gt;
* [[Using CEGUI with SDL and OpenGL]] - Guidelines on how to get SDL, OpenGL and CEGUI running together.&lt;br /&gt;
* [[Using CEGUI with Producer and OpenGL]] - Guidelines on how to render and inject input to CEGUI from the Producer API.&lt;br /&gt;
* [http://artis.imag.fr/Membres/Xavier.Decoret/resources/CEGUI/ Using CEGUI with Qt/QGLViewer]&lt;br /&gt;
* [[Using CEGUI with GLUT]] - Some tips on using OpenGL's GLUT with CEGUI.&lt;br /&gt;
&lt;br /&gt;
=== Extending CEGUI ===&lt;br /&gt;
&lt;br /&gt;
* [[Using Expat XML parser within CEGUI]] - How to add support for another XML parser.&lt;br /&gt;
&lt;br /&gt;
=== Skins - Tutorial For Artists ===&lt;br /&gt;
* [[Creating Skins]] - Extra notes for artists on how to create skins.&lt;br /&gt;
* [[The Beginners Guide to Falagard skinning - Part I]] - Learn by doing a Button.&lt;br /&gt;
* [[The Beginners Guide to Falagard skinning - Part II]] - More Falagard fun, this time with the Editbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Overviews ===&lt;br /&gt;
* [[Overview of GUI files]] - A quick introduction to all the XML files used by CEGUI.&lt;br /&gt;
* [[Overview of resource system enhancements in 0.5.0]] - Introduction to enhancements made for the 0.5.0 release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous HOW-TOs ===&lt;br /&gt;
* [[Create ImageButtons]] - A few different ways to create image buttons.&lt;br /&gt;
* [[Create a CheckListboxItem]] - Create a CheckListBoxItem that you can use with ItemListbox.&lt;br /&gt;
* [[Identifying Multiple Event Sources From A Single Callback]]&lt;/div&gt;</summary>
		<author><name>Ldb</name></author>	</entry>

	</feed>