Page 1 of 1

Why do I have to name every window?

Posted: Wed Jul 13, 2005 22:52
by jed
Is there a way to not have to come up with a unique name for windows when you create them with
Window * CEGUI::WindowManager::createWindow(const String& type,const String& name)

I'm creating the windows dynamically and I really dont care what the window is called. It seems like now I have to write code to generate a name. This seems lame.

Re: Why do I have to name every window?

Posted: Wed Jul 13, 2005 23:30
by lindquist
This is how CEGUI works. You'll have to live with it!

I don't see the big issue with gerating a unique name for your windows, this could easily just be a counter:

Code: Select all

#include "CEGUIPropertyHelper.h"

CEGUI::String NewWindowName(void)
{
    static CEGUI::uint counter = 0;
    return CEGUI::PropertyHelper::uintToString(counter++);
}


But there are of course reasons for having the name based WindowManager, XML being one major.

Re: Why do I have to name every window?

Posted: Wed Jul 20, 2005 09:53
by kristian
Entities must have some kind of identification. A string is the most generic form of identification and is very suitable in many dffirent scenarios/solutions.