void CEGUIListbox::Init (Window* widget) { Listbox *listbox = reinterpret_cast<Listbox *> (widget); listbox->subscribeEvent (Window::EventMouseClick, Event::Subscriber (&CEGUIListbox::OnMouseClick, this)); m_ceListbox = listbox; m_widgetName = new char[strlen (widget->getName().c_str()) + 1]; strcpy (m_widgetName, widget->getName().c_str()); }
void CEGUIListbox::Init (const orxSTRING widgetName) { const orxSTRING windowName = m_manager->GetName (); Window *rootWindow = CEGUI::System::getSingleton ().getGUISheet (); Window *window = rootWindow->getChild (windowName); Listbox *listbox = reinterpret_cast<Listbox *> ( window->getChild (widgetName)); listbox->subscribeEvent (Window::EventMouseClick, Event::Subscriber (&CEGUIListbox::OnMouseClick, this)); m_ceListbox = listbox; m_widgetName = new char[strlen (widgetName) + 1]; strcpy (m_widgetName, widgetName); }