So I've got two layouts loaded into my program. The first takes care of different windows on the sides of the screen, a chatbox and a combatlog and some other stuff.
The other layout is a window that contains a bunch of buttons. A sort of commandcenter. Right now, I have one button on the commandcenter, and it is definately set to enabled and visible.
The problem is that it doesn't seem active, because the image doesn't change on hover, and the callback is never executed. In debug, I can clearly see that the commandcenter is active.
What has happened?
ps. I'm using version 0.6.3 ds.
EDIT: Nevermind, I solved it. Apparently I had to activate it to.
Another problem arises though. The callback-function is a memberfunction from a class called DeploymentState.
This is what I do when I initialize the button:
Code: Select all
CEGUI::Window* pWnd = pSquadWindow->getChildAtIdx(i);
if(i < pForce->getNumSquads())
{
pWnd->setID(SquadList.at(i)->getSquadID());
BindButtonToFunction(pWnd, CEGUI::Event::Subscriber(&Deployment::btnPickSquad, m_pDeployment));
pWnd->enable();
pWnd->setVisible(true);
pWnd->activate();
m_SquadSelectionButtons.push_back(pWnd);
} else
{
pWnd->disable();
pWnd->setVisible(false);
}
Code: Select all
void BindButtonToFunction(CEGUI::Window* pWnd, CEGUI::Event::Subscriber& subscriber)
{
pWnd->subscribeEvent(CEGUI::PushButton::EventMouseClick, &subscriber)
}
Why does not this work?
Edit: Forgot to tell you. The error is in the function
Code: Select all
virtual bool operator()(const EventArgs& args)
{
return (*d_functor)(args);
}
in the header ceguifunctorpointerslot.h, and it seems that d_functor is equal to NULL.