Page 1 of 1

Name of events

Posted: Tue Nov 28, 2006 13:57
by vr
Is there a simple way of getting the available Events for a specified Window?

I have for example a Radiobutton, in the API documentation is has a method named EventSelectStateChanged" and onSelectStateChanged

None works with w:subscribeEvent("EventSelectStateChanged", "setupWorldEnableCallback")

or w:subscribeEvent("onSelectStateChanged", "setupWorldEnableCallback")

and finally SelectStateChanged.
None of the above works.

I can get a slider to work, and ordinary button (with Clicked) but not this Radiobutton, it just doesnt respond...

Any hints?

Posted: Tue Nov 28, 2006 14:14
by Rackle
Taken from Formatted Numeric Data:

radiobutton->subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&DemoSample::onCurrencySelected, this));

where DemoSample is the name of a class. The function called is defined as follows:

bool DemoSample::onCurrencySelected(const CEGUI::EventArgs& e)
{
return true;
}

You are better off using the Cegui constants rather than using literal strings.

Posted: Tue Nov 28, 2006 14:27
by vr
MM, assuming you are working in C++, which I am not. Im using CEGUI using lua.


Im sorry I didnt explicitly say that.. (could have been derived from my code examples though).

So the problem is still....a problem.

Where can I find the exported Event names, and why couldnt one throw an exception upon specifying an unexisting events?