[SOLVED] Forward Slash Not Being Recognized in Window Name

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

kabbotta
Just popping in
Just popping in
Posts: 11
Joined: Tue Mar 10, 2015 01:47

[SOLVED] Forward Slash Not Being Recognized in Window Name

Postby kabbotta » Mon Jun 15, 2015 00:52

I'm using CEGUI with my Ogre3d project, and I'm having a problem where names that are defined using the forward slash pattern, such as:

Code: Select all

name="Root/HealthBar"


are not being recognized as valid names when I try to access them from in code. I know everything is working fine, because if I take the / out of the name, then it recognizes things just fine. Did I mess up the formatting of my strings somehow in the XML file?
Last edited by kabbotta on Mon Jun 15, 2015 01:06, edited 1 time in total.

lucebac
Just can't stay away
Just can't stay away
Posts: 193
Joined: Sat May 24, 2014 21:55

Re: Forward Slash Not Being Recognized in Window Name

Postby lucebac » Mon Jun 15, 2015 01:01

When getting windows via parent->getChild("name") the "/" in the window name is something like a path separator on a filesystem:
getChild("win_a/win_b") means "get win_b that is (direct) child of win_a"

Therefore: don't use forward slashes in window names!

The solution for your problem would be to just create some widget named "Healthbar" and add it to the "Root" widget.

kabbotta
Just popping in
Just popping in
Posts: 11
Joined: Tue Mar 10, 2015 01:47

Re: Forward Slash Not Being Recognized in Window Name

Postby kabbotta » Mon Jun 15, 2015 01:05

Ah, thanks for clearing that up so fast. I must have been reading some old documentation, because I swore that I read people used the forward slash naming convention to avoid conflicts. I like the way it actually works much better than that anyway!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 22 guests