Page 1 of 1

Duplicating a window

Posted: Tue Oct 10, 2006 21:22
by arkos
Hello,

I want to duplicate a window.

I tried:

Code: Select all

CEGUI::Window* t = CEGUI::WindowManager::getSingleton().createWindow("WindowsLook/FrameWindow", "testframe");
   (*t) = (*(getWindow("report_win")));

but got compiler error, "cannot access protected member declared in class 'CEGUI::Window'.

*after I copied the window, I was going to change its name to be unique.

So how do I copy a window?

Posted: Tue Oct 10, 2006 21:39
by arkos
I figured out that the window would have to be static cast

Code: Select all

CEGUI::Window* t = CEGUI::WindowManager::getSingleton().createWindow("WindowsLook/FrameWindow", "testframe");
   *((CEGUI::FrameWindow*)t) = *((CEGUI::FrameWindow*)getWindow("report_win"));


This compiles, however, upon intellisensing CEGUI::Window::Window() it seems that windows are not meant to be copied or assigned this way. :(

Posted: Wed Oct 11, 2006 13:45
by Rackle
A long long time ago, in a post far far away...I had started some work on creating multiple windows based on a single .layout file. You can find that code here. It's incomplete but might give you an idea. If you do make it work please put the finished code within the Wiki; that feature may be useful to others.