Hi i've began to use cegui with irrlicht. I'm trying to use itemlistbos in a layout, in my code i'm catching the event of the itemlistbox:
ptfunction=HandleSetupVideoScreenResolution;
if (Guiwmgr->isWindowPresent("TabSetupVideo/ItemListbox"))
{
ItemListbox *tmp;
tmp=(ItemListbox *)WindowManager::getSingleton().getWindow("TabSetupVideo/ItemListbox");
tmp->subscribeEvent(ItemListbox::EventSelectionChanged,Event::Subscriber(ptfunction));
}
all is ok (compilation and execution), but when i try to gain access to the text of the item selectionned i've got a crash :
bool HandleSetupVideoScreenResolution(const CEGUI::EventArgs& e)
{
Terminer=false;
ItemListbox *tmp;
ItemEntry *ite;
tmp=(ItemListbox *)WindowManager::getSingleton().getWindow("TabSetupVideo/ItemListbox");
if (tmp->getSelectedCount()==0)
{
m_Logger->log("Error no item selectionned");
}
else
{
m_Logger->log("probably a selection");
ite=(ItemEntry *)tmp->getFirstSelectedItem(0);
if (ite==NULL)
{
m_Logger->log("Error no selection");
}
else
{
m_Logger->log("Trace 1");
if (ite->isSelected())
{
m_Logger->log("Hello");
}
char buffer[100];
sprintf(buffer,"%s",ite->getText()); ====> CRASH
m_Logger->log(buffer);
}
}
return true;
}
What's wrong with my function ?
Thank's for your reply
can't access text from itemlistbox
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Who is online
Users browsing this forum: No registered users and 17 guests