define an event for a QuickGUI::Image


18-07-2010 20:59:05

i've a list of QuickGUI::Image and i want to know if it's possible to define an even so that when i click on an pic i can get the image name and put it into a text area, the image name was defined using the imgDescriptor and the image_imageName attribute.

thanks! :)


18-07-2010 21:23:28

ok with this code i get the name of the widget:

const QuickGUI::MouseEventArgs& mouseEventArgs = dynamic_cast<const QuickGUI::MouseEventArgs&>(args);

QuickGUI::Widget* wd = mouseEventArgs.widget;
Ogre::String stringa = wd->getName();

i guess now i simply have to put the String in my textArea! :)


18-07-2010 21:47:58

i tried with


where charName is a TextArea, but i cant see the word "test" in the textArea..


19-07-2010 18:27:05

Hm, that should work. I wonder what the default font is. Can you try adding text with a specified font? What about trying the setText API, does it display text then?


19-07-2010 23:08:24

the default font is micross.12, anyway i solved it :D...using setText :
charName->setText( segments );

it works if i use segments, while it doesnt with String, im wondering why...anyway im happy thanks:D