[solved]problem with eventComboAccept and newDelegate

theainur

28-01-2009 18:32:35

Hello,

I'm tying to make a chat box for my application with MyGUI and I get an error during the building process ^^


mComboChat = mGUI->findWidget<MyGUI::ComboBox>("comboChat");
mButtonChat = mGUI->findWidget<MyGUI::Button>("buttonEnvoyer");

mComboChat->eventComboAccept = MyGUI::newDelegate(this, &CLASS::notifyComboChatAccept);
mComboChat->eventKeyButtonPressed = MyGUI::newDelegate(this, &CLASS::notifyButtonChatPressed);
mButtonChat->eventMouseButtonClick = MyGUI::newDelegate(this, &CLASS::notifyMouseButtonChatClick);


Here are the headers of the methods I call:

void CLASS::notifyMouseButtonChatClick(MyGUI::WidgetPtr _sender)
...
void CLASS::notifyComboChatAccept(MyGUI::ComboBoxPtr _sender, size_t _index)
...
void CLASS::notifyButtonChatPressed(MyGUI::WidgetPtr _sender, MyGUI::KeyCode _key)
...



I think I use the right signature for my methods, however I still get this error for the line
"mComboChat->eventComboAccept = MyGUI::newDelegate(this, &CLASS::notifyComboChatAccept);"

"no match for 'operator=' in '((CLASS*)this)->CLASS::mComboChat->MyGUI::ComboBox::eventComboAccept =
MyGUI::delegates::newDelegate [with TObj = CLASS, TP1 = MyGUI::Widget*, TP2 = size_t](this, &CLASS::
notifyComboChatAccept)'|"

thanks

my.name

28-01-2009 18:53:56

/** Event : Enter pressed in combo mode or item selected in drop.\n
signature : void method(MyGUI::ComboBoxPtr _sender, size_t _index)
@param _sender widget that called this event
@param _index item
*/

Altren

28-01-2009 19:00:47

"no match for 'operator=' in '((CLASS*)this)->CLASS::mComboChat->MyGUI::ComboBox::eventComboAccept =
MyGUI::delegates::newDelegate [with TObj = CLASS, TP1 = MyGUI::Widget*, TP2 = size_t](this, &CLASS::
notifyComboChatAccept)'|"
Check that you have right signature not only in declaration. As you can see compiler says that you have MyGUI::WidgetPtr, size_t

theainur

28-01-2009 21:18:42

Thank you for your help.
Everything works fine now.