Why do I have to name every window?

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

User avatar
jed
Just popping in
Just popping in
Posts: 14
Joined: Fri May 20, 2005 14:51

Why do I have to name every window?

Postby jed » Wed Jul 13, 2005 22:52

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.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: Why do I have to name every window?

Postby lindquist » Wed Jul 13, 2005 23:30

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.

User avatar
kristian
Just popping in
Just popping in
Posts: 12
Joined: Wed Apr 13, 2005 17:25

Re: Why do I have to name every window?

Postby kristian » Wed Jul 20, 2005 09:53

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.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 17 guests