[SOLVED] How to hide a window?

Revy

27-01-2009 20:02:48

Hello everybody, first of all I would like to thank you guys for putting in so much time into developping MyGUI which is really a great GUI in my opinion!

I'm trying to create a window for Ogre with a button to close (or hide?) it and I get a little problem...

my code:
MyClass header:
MyGUI::VectorWidgetPtr win;

MyClass source:
winAccueil = MyGUI::LayoutManager::getInstance().load("accueil.layout");

MyGUI::ButtonPtr MyButton = mGUI->findWidget<MyGUI::Button>("MyButton");
MyButton->eventMouseButtonClick = MyGUI::newDelegate(this, &MyClass::hide);


Method hide from MyClass:
void MyClass::hide(MyGUI::WidgetPtr _widget, bool _double)
{
win[0]->hide();
}


But I get an error while building:
"MyClass.cpp|19|error: no match for 'operator=' in '(((MyGUI::WidgetEvent*)MyButton) + 108u)->MyGUI::WidgetEvent::eventMouseButtonClick = MyGUI::delegates::newDelegate [with TObj = MyClass, TP1 = MyGUI::Widget*, TP2 = bool](this, &MyClass::hide)'|"
(pertaining to this lign: "MyButton->eventMouseButtonClick = MyGUI::newDelegate(this, &MyClass::hide);")

I don't understand where the problem could be but I think I made a stupid error somewhere ^^

Thank you!

Altren

27-01-2009 20:17:19

/** Event : Mouse button pressed and released.\n
signature : void method(MyGUI::WidgetPtr _sender)
@param _sender widget that called this event
*/
EventHandle_WidgetVoid eventMouseButtonClick;
signature : void method(MyGUI::WidgetPtr _sender) void MyClass::hide(MyGUI::WidgetPtr _sender)
{
win[0]->hide();
}

Revy

27-01-2009 20:47:36

Thank you very much for your fast answer, my button works perfectly now!
I knew my error was stupid! ^^