Page 1 of 1

[SOLVED] Window hangs around after deletion

Posted: Mon Jan 11, 2016 13:18
by mmixLinus
Hi!

After destroying the child (a Listbox called "WebPopupMenu") of an RTT GUIContext root window, it is still visible. I want it gone! :wink:

Code: Select all

   CEGUI::Window   *root = CApplication::getSingleton().getGUIContext(m_sOverlayName)->getRootWindow();
      CEGUI::Listbox *lb = static_cast<CEGUI::Listbox *>(root->getChild(POPUPMENU_NAME));
      root->destroyChild(lb);
//      root->destroyChild(POPUPMENU_NAME);
The Listbox IS deleted from the CEGUI window tree (I know, because I can create it again (same name)). Even doing an "lb->setVisible(false)" has no effect.

Any ideas what's wrong? Seems like the root window isn't updated after the destroyChild(). I can see that my other buttons are updated because they highlight properly when I hover over them. I tried root->invalidate(true) after destroyChild() but no change.. Maybe the Listbox area isn't cleared because the root window is transparent?

Code: Select all

11/01/2016 13:58:50 (Std)    ********************************************************************************
11/01/2016 13:58:50 (Std)    * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM       -------- *
11/01/2016 13:58:50 (Std)    ********************************************************************************
11/01/2016 13:58:50 (Std)    ---- Version: 0.8.4 (Build: Nov 13 2015 Debug Microsoft Windows MSVC++ 12.0 (2013) 32 bit) ----
11/01/2016 13:58:50 (Std)    ---- Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
11/01/2016 13:58:50 (Std)    ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
11/01/2016 13:58:50 (Std)    ---- Image Codec module is: OgreImageCodec - Integrated ImageCodec using the Ogre engine. ----
11/01/2016 13:58:50 (Std)    ---- Scripting module is: None ----
11/01/2016 13:58:50 (Std)    ********************************************************************************
11/01/2016 13:58:50 (Std)    * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM         -------- *
11/01/2016 13:58:50 (Std)    ********************************************************************************

Start of layout of GUI Context root window:

Code: Select all

<GUILayout version="4">
  <Window type="DefaultWindow" name="Overlay_WebPage">
    <Property name="InheritsAlpha"                value="False" />
    <Property name="Alpha"                      value="1.0" />
    <Property name="Visible"                      value="True" />
    <Property name="Position"            value="{{0.0,0},{0.0,0}}" />
    <Property name="Size"                value="{{1.0,0},{1.0,0}}" />
    <Property name="MaxSize"             value="{{1.0,0},{1.0,0}}" />
    <Property name="AlwaysOnTop"                value="False" />
    <Property name="MousePassThroughEnabled"    value="True" />
     <Event    name="Clicked"                    function="handlerOverlayClicked" />

The Listbox is destroyed:

Code: Select all

11/01/2016 13:59:33 (Info)    Window at 'Overlay_WebPage/WebPopupMenu' will be added to dead pool. (002EDCE0)
11/01/2016 13:59:33 (Info)    Window at 'Overlay_WebPage/WebPopupMenu/__auto_hscrollbar__' will be added to dead pool. (002ECF64)
11/01/2016 13:59:33 (Info)    Window at 'Overlay_WebPage/WebPopupMenu/__auto_hscrollbar__/__auto_incbtn__' will be added to dead pool. (002EC1E8)
11/01/2016 13:59:33 (Info)    Window at 'Overlay_WebPage/WebPopupMenu/__auto_hscrollbar__/__auto_decbtn__' will be added to dead pool. (002EC1E8)
11/01/2016 13:59:33 (Info)    Window at 'Overlay_WebPage/WebPopupMenu/__auto_hscrollbar__/__auto_thumb__' will be added to dead pool. (002EC1E8)
11/01/2016 13:59:33 (Info)    Window at 'Overlay_WebPage/WebPopupMenu/__auto_vscrollbar__' will be added to dead pool. (002ECF64)
11/01/2016 13:59:33 (Info)    Window at 'Overlay_WebPage/WebPopupMenu/__auto_vscrollbar__/__auto_incbtn__' will be added to dead pool. (002EC1E8)
11/01/2016 13:59:33 (Info)    Window at 'Overlay_WebPage/WebPopupMenu/__auto_vscrollbar__/__auto_decbtn__' will be added to dead pool. (002EC1E8)
11/01/2016 13:59:33 (Info)    Window at 'Overlay_WebPage/WebPopupMenu/__auto_vscrollbar__/__auto_thumb__' will be added to dead pool. (002EC1E8)

Help much appreciated!
/mmixLinus

Re: Window hangs around after deletion

Posted: Mon Jan 11, 2016 21:05
by Ident
Why do you only post the start of the layout?

Re: Window hangs around after deletion

Posted: Mon Jan 11, 2016 21:59
by mmixLinus
Ident, sorry, I thought my problem was due to some crucial root window setting. However I SOLVED it a minute ago, hehe. I was missing this, silly me:

Code: Select all

         static_cast<CEGUI::TextureTarget&>(guic->getRenderTarget()).clear();
AND it solved THIS! My old RTT Alpha weirdness from almost two years ago! Admittedly, I haven't been working on this code for almost that long :lol: But my smooth alpha shadows look just great!

Re: [SOLVED] Window hangs around after deletion

Posted: Mon Jan 11, 2016 22:55
by Ident
See also: http://cegui.org.uk/wiki/Rendering_to_t ... 9_in_CEGUI

, which I wrote a while ago and where the proper way to use RTTs is described :pint:

Re: [SOLVED] Window hangs around after deletion

Posted: Tue Jan 12, 2016 23:21
by mmixLinus
Yes, I know, I know!! :D I am using that page! (Obviously with bits missing :D) :hammer: