Page 1 of 1

Dynamically changing a window's frame

Posted: Fri Jan 26, 2007 12:03
by adonf
Hi,

I'm trying to adapt an Ogre sample from CEGUI version 0.4 to 0.5 and I'm stuck on a call to StaticText::setFrameImages() like this:

Code: Select all

StaticText* panel = (StaticText*)WindowManager::getSingleton().createWindow("WindowsLook/StaticText", "Panel 1"); "Panel 1");
panel->setFrameImages(
   &set->getImage(TopLeft), &set->getImage(TopRight),
   &set->getImage(BottomLeft), &set->getImage(BottomRight),
   &set->getImage(Left), &set->getImage(Top),
   &set->getImage(Right), &set->getImage(Bottom) );

where TopLeft, TopRight, etc are image names inside ImageSet set

In CEGUI 0.5 StaticText was replaced by Window that doesn't have the setFrameImages method. I found quite a bit of sample code on how to dynamically change a Button object's texture, but not the frame.

I thought that I coul to use the same method as Crazy Eddie suggested here but the ImageProperty tag can only be used inside an ImageComponent and not a FrameComponent (FalagardSkinning.pdf page 74).

Is there a way to do what I want ? I'm sure there are workarounds to get the Ogre sample to work, like creating another widget type, but I'm going to need this in my own project, so it's important for me that the user can select any set of images as a frame.

Thanks !

Posted: Wed Feb 07, 2007 16:07
by Fenrir
I have the same question, I would like to dynamically change the backgroud image of a FrameWindow into my code.

Is it possible ? Thanks in advance for any help. :)

Posted: Mon Feb 12, 2007 11:40
by adonf
if by backgound image you meant the tiled frame then it's not supported by CEGUI 0.5

i don't think that changing the one-image background of a FrameWindow is supported either with WindowsLook or TaharezLook, you'll have to modify the existing loooknfeel files to add this feature.