Page 1 of 1

How to subscribing to events using the layout approach?

Posted: Tue Sep 19, 2006 11:23
by extrakun
Hi all,

I have been trying to follow the 'Main Menu' code snippet. I have managed to load a layout, but am having problem subscribing the widget to events. The way the code snippet is parsed kind of unclear too. Where can I find additional information?

Many thanks in advance!

Note: I manage to get the hard-coded method (calling the subscribe method of each widget) to work, and have confirmed that inputs are injected to CEGUI. I am using Ogre 1.2

Posted: Tue Sep 19, 2006 14:27
by Rackle
You can look at the samples included within the SDK: cegui_mk2\Samples I recommend Demo7.

Posted: Tue Sep 19, 2006 16:58
by extrakun
Rackle wrote:You can look at the samples included within the SDK: cegui_mk2\Samples I recommend Demo7.


Hi, I assume by the SDK, you mean the one downloadable from this site, not the one which comes with Ogre 1.2?

Posted: Tue Sep 19, 2006 17:35
by Rackle
The one from the Cegui download will be the most recent one. The one from Ogre is v0.4, unless you download from the CVS. But regardless, Demo 7 from pretty much any source is still worth a look as it seems to be the most complete/comprehensive and it is the one that I used to turn to the most for reference information.

You can have a look at Widget Galore for a basic how-to for most widgets (excludes menu). There are no events but it covers how to specify a value and how to retrieve it, which is at the core of the functionality of widgets.