Page 1 of 1

CEGUI Callback

Posted: Mon Aug 09, 2010 08:54
by dehseth
Hi everyone,

I am using Irrlicht and I am new to CEGUI. I would like to know if there's a global callback function in CEGUI. Let's say I created a window put two textboxes and two buttons in it. I saw a register event sapmle code to call if a pushbutton is clicked:

Code: Select all

PushButton * baglan = static_cast<PushButton*>(System::getSingleton().getGUISheet()->getChild("Root/Anamenu")->getChild("Root/Anamenu/Button1"));
   baglan->subscribeEvent(PushButton::EventClicked,CEGUI::Event::Subscriber(&Engine::BaglanButton,this));


What I need is to subscribe all events. Is there a callback in CEGUI which I can register in my code and CEGUI calls back every time an event occurs regaredless of the type of object and event? If there isn't why :D

Re: CEGUI Callback

Posted: Mon Aug 09, 2010 10:21
by CrazyEddie
No, this is not available. The reason being is that I think monolithic handlers like that (i.e. MS Windows WndProc type things) are horrible, promote poor coding practices and I'll have no part of it ;) I'm aware there are fans of this approach, but for CEGUI it will never happen - sorry :D

CE.

Re: CEGUI Callback

Posted: Mon Aug 09, 2010 10:30
by dehseth
Maybe this would be a good time to reconsider it. As you said some people (like me) would like to use it. It'd be nice if we have choices :)

Re: CEGUI Callback

Posted: Mon Aug 09, 2010 16:38
by Jamarr
I would like to hear the reasoning behind wanting to use a monolithic event handler. Because I am having a hard time coming up with any worth while merits...