Hi:
I am writing a multi page application. I load multiple layouts and assign each of them a name. Later when some button event happens, i wish to find that on which layout event occured...
I am doing this but program crashes without logging any error message.
CEGUI::WindowManager *wMgr = CEGUI::WindowManager::getSingletonPtr();
CEGUI::Window *win = wMgr->getWindow((CEGUI::utf8*)"RootWindow");
currentWin = win->getActiveChild()->getName();
Any clue on what is the correct way of achieving this...
Thanks
Saurabh
Fetching the windowName
Moderators: CEGUI MVP, CEGUI Team
Re: Fetching the windowName
Crash is happening due to line...
currentWin = win->getActiveChild()->getName();
I am wondering about the role of getActiveChild api. What would it do? Will it return me the layout which i have set visible and attached as a child of rootWindow.
Thanks
Saurabh
currentWin = win->getActiveChild()->getName();
I am wondering about the role of getActiveChild api. What would it do? Will it return me the layout which i have set visible and attached as a child of rootWindow.
Thanks
Saurabh
Re: Fetching the windowName
I looked into API's documentation. The use getActiveChild() is peculiar.
I thought it'll return the pointer to layout which is active but it is returning a this pointer and also documentation does not say that what will be returned if input is focused on one of the child window and that window is active.
I am presuming that window being active means the window which is visible and has input focus. ...
so suppose we have
X--> Y ---> Z
X--> A ---> B
if Z is the textbox window with input focus then X->getActiveChild() should return pointer to Y .
Thanks
Saurabh
I thought it'll return the pointer to layout which is active but it is returning a this pointer and also documentation does not say that what will be returned if input is focused on one of the child window and that window is active.
I am presuming that window being active means the window which is visible and has input focus. ...
so suppose we have
X--> Y ---> Z
X--> A ---> B
if Z is the textbox window with input focus then X->getActiveChild() should return pointer to Y .
Thanks
Saurabh
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Fetching the windowName
Hi,
The function is possibly poorly named (or at least the docs could be more specific), but this function is behaving in the way intended (and it's always been that way).
CE.
The function is possibly poorly named (or at least the docs could be more specific), but this function is behaving in the way intended (and it's always been that way).
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Fetching the windowName
Hi:
I am trying to get the window name...
If suppose i declare a window with this line...
loginSheet = CEGUI::WindowManager::getSingletonPtr()->loadWindowLayout((CEGUI::utf8*)"loginlayout.layout", "LOGIN_WINDOW");
mWindow->addChildWindow(loginSheet);
where mWindow is CEGUI::Window *
Now if i do this...
mWindow->getChildAtIdx(id-1)->getName()
then what should it return. Problem is that i am not able to debug my code because once OGRE renders the sheet then if i press some button once, it just hangs instead of returning to break point and it does not allow me to see what is the output of mWindow->getChildAtIdx(id-1)->getName().
Problems:
1. Ideal output of mWindow->getChildAtIdx(id-1)->getName()
2. How to debug a after OGRE renders the layout. Instead of hitting break point, application just hangs if any event happens after that....
Thanks
Saurabh
I am trying to get the window name...
If suppose i declare a window with this line...
loginSheet = CEGUI::WindowManager::getSingletonPtr()->loadWindowLayout((CEGUI::utf8*)"loginlayout.layout", "LOGIN_WINDOW");
mWindow->addChildWindow(loginSheet);
where mWindow is CEGUI::Window *
Now if i do this...
mWindow->getChildAtIdx(id-1)->getName()
then what should it return. Problem is that i am not able to debug my code because once OGRE renders the sheet then if i press some button once, it just hangs instead of returning to break point and it does not allow me to see what is the output of mWindow->getChildAtIdx(id-1)->getName().
Problems:
1. Ideal output of mWindow->getChildAtIdx(id-1)->getName()
2. How to debug a after OGRE renders the layout. Instead of hitting break point, application just hangs if any event happens after that....
Thanks
Saurabh
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Fetching the windowName
Hi,
1) Depending upon the name of the top-level window in the layout file (here I'll assume 'Root' for the sake of simplicity), and assuming the index (id -1) accesses the window added in the line:
Then the name would be returned as "LOGIN_WINDOWRoot".
2) Nowhere near enough information given here. What OS? What compiler? Windowed or full-screen? What have you tried, exactly, to narrow down the issue? In this context, what does 'hang' mean?
CE.
1) Depending upon the name of the top-level window in the layout file (here I'll assume 'Root' for the sake of simplicity), and assuming the index (id -1) accesses the window added in the line:
Code: Select all
mWindow->addChildWindow(loginSheet);
Then the name would be returned as "LOGIN_WINDOWRoot".
2) Nowhere near enough information given here. What OS? What compiler? Windowed or full-screen? What have you tried, exactly, to narrow down the issue? In this context, what does 'hang' mean?
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Fetching the windowName
Does your debugger not have a Break All command? You might also want to invest in logging...
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Re: Fetching the windowName
Hi,
It works perfectly.
I was not initializing the variable so crash was happening. Sorry for not providing enough details for post mar-tam...
But will take care next time...
Thank
Saurabh
It works perfectly.
I was not initializing the variable so crash was happening. Sorry for not providing enough details for post mar-tam...
But will take care next time...
Thank
Saurabh
Return to “Offtopic Discussion”
Who is online
Users browsing this forum: No registered users and 8 guests