icaromotta
09-07-2010 22:08:28
Hi,
I can not understand why I can not access some functions when using findWidget through an event.
declaring:
another widget than will set my list to invisible:
Here, the code
The only solution to this would make the list a member of the class?
thanks.
I can not understand why I can not access some functions when using findWidget through an event.
declaring:
QuickGUI::ListDesc * listaDesc = QuickGUI::DescManager::getSingleton().getDefaultListDesc();
listaDesc->resetToDefault();
listaDesc->widget_name = "List";
listaDesc->widget_dimensions = QuickGUI::Rect(100, 100, 480, 100);
QuickGUI::List *lista = mySheet->createList(listaDesc);
lista->createTextItem("Icaro", 0);
another widget than will set my list to invisible:
QuickGUI::Menu *m3 = m2->createSubMenu(segments);
m3->addWidgetEventHandler(QuickGUI::WIDGET_EVENT_MOUSE_BUTTON_UP, &BaseApplication::setListVisible, this);
Here, the code
void BaseApplication::setListVisible(const QuickGUI::EventArgs& args)
{
const QuickGUI::WidgetEventArgs& wea = dynamic_cast<const QuickGUI::WidgetEventArgs&>(args);
QuickGUI::List *l = dynamic_cast<QuickGUI::List*>(wea.widget->findWidget("List"));
//crash here, because setVisible is protected
l->setVisible(! lista->getVisible());
}
The only solution to this would make the list a member of the class?
thanks.