Delegate Deprecation

xtitus

15-11-2014 20:27:29

I'm running 3.2 MyGUI, and everything runs great, but I get compiler warnings about Delegate deprecation. I'm using the newDelegate style described in the Ogre wiki, is there a better / newer way I'm suppose to be using them? Ex below of my MyGUI::Button called mGenerate.


mGenerate->eventMouseButtonClick = MyGUI::newDelegate(this, &MainPanel::notifyGenerateClick);


Generates


/home/xtitus/treestudio/src/designer/MainPanel.cpp:17: warning: 'MyGUI::delegates::CMultiDelegate1<TP1>& MyGUI::delegates::CMultiDelegate1<TP1>::operator=(MyGUI::delegates::CMultiDelegate1<TP1>::IDelegate*) [with TP1 = MyGUI::Widget*; MyGUI::delegates::CMultiDelegate1<TP1>::IDelegate = MyGUI::delegates::IDelegate1<MyGUI::Widget*>]' is deprecated (declared at /usr/include/MYGUI/MyGUI_DelegateImplement.h:356) [-Wdeprecated-declarations]
mGenerate->eventMouseButtonClick = MyGUI::newDelegate(this, &MainPanel::notifyGenerateClick);
^

Altren

15-11-2014 20:55:29

We changed from assigning delegates to adding/removing them, so you should use "+=" instead of "=" in your code. We use C# like delegate syntax.

xtitus

15-11-2014 22:52:05

Perfect. I like that syntax as well. Thanks for the quick response. :)