Coloured rectangles

Redminnow

12-01-2009 18:41:37

I found this example code on the forums however i can't seem to get it to work:


MyGUI::WidgetPtr widget = mGUI->createWidget<MyGUI::Widget>("RawRect", MyGUI::IntCoord(20, 20, 20, 20), MyGUI::Align::Default, "Main");
MyGUI::RawRect* colour_rect = widget->getSubWidgetMain()->castType<MyGUI::RawRect>();
colour_rect->setRectColour(MyGUI::Colour::Green, MyGUI::Colour::Green, MyGUI::Colour::Green, MyGUI::Colour::Green);


getSubWidgetMain() and MyGUI::Colour::Green doesn't seem to exsist, i assume it's something like


MyGUI::WidgetPtr widget = mGUI->createWidget<MyGUI::Widget>("RawRect", MyGUI::IntCoord(20, 20, 20, 20), MyGUI::Align::Default, "Main");
MyGUI::RawRect* colour_rect = widget->castType<MyGUI::RawRect>();
colour_rect->setRectColour(Ogre::ColourValue::Blue, Ogre::ColourValue::Blue, Ogre::ColourValue::Blue, Ogre::ColourValue::Blue);

doesn't seem to work tho, any ideas? Thanks

Five_stars

12-01-2009 18:50:51

It seems that you have not last version of MyGUI. Update from SVN if you want to use this. (I've already checked - MyGUI::Colour and getSubWidgetMain exists)