How to add event in 10.8?

zillenjack

06-09-2010 14:43:25

Hi!
Can you show me the Button demo of event?
thank you very much!

kungfoomasta

08-09-2010 17:47:05

Doh! Sorry I have family over and haven't been checking forums like I wanted.

I will write a tutorial on this, but here is basically what you would do:

QuickGUI::MessageManager::getSingletonPtr()->subscribeToMessage(QuickGUI::DefaultMessageType::MouseButtonUp,myButton->getName(),myMessageHandler);

Parameter one is the message type. Parameter two is the name of the source of this message. Parameter three is the message handler that will receive the message. In order to be a message handler, you must inherit from QuickGUI::MessageHandler class.

void MyClass::handleMessage(QuickGUI::Message m)
{
if(m.messageType == QuickGUI::DefaultMessageType::MouseButtonUp)
{
; // do something useful
}
}

kungfoomasta

08-09-2010 19:27:33

This tutorial should clear things up:

http://www.ogre3d.org/tikiwiki/QuickGUI+Basics