Priyank.Jain2 Posted February 20, 2017 Posted February 20, 2017 In our application we are popping out some widgets into separate window something like this: //PopoutWindow.h Widget m_content; //not working Widget test; //working PopoutWindow( Widget content ) { m_content = content; test = new WidgetButton(gui, "test button"); //create new InterfaceWindow } void SetWindowDockMode( int mode ) { Gui gui = engine.getGui(); if( mode == WindowMode_Docked ) { m_externalGui.removeChild( m_content ); m_externalGui.removeChild( test); gui.addChild( m_content, GUI_ALIGN_OVERLAP ); gui.addChild( test, GUI_ALIGN_OVERLAP ); m_externalWindow.setHidden(true); } else if( mode == WindowMode_Undocked ) { gui.removeChild( m_content ); m_externalGui.addChild( m_content ); gui.removeChild( test); m_externalGui.addChild( test); m_externalWindow.setHidden(false); } m_popoutSprite.SetHidden( mode == WindowMode_Undocked ); m_windowMode = mode; } void Update() { if( m_windowMode == WindowMode_Docked ) { // External window is open -> make sure we are in the correct window dock state if( m_externalWindow.WasOpened() ) { SetWindowDockMode( WindowMode_Undocked ); } m_content.setHidden( LoadingScreen::IsVisible() ? true : !m_isVisible ); test.setHidden( LoadingScreen::IsVisible() ? true : !m_isVisible ); } else { m_content.arrange(); m_externalWindow.ResizeFor( m_content ); // Did the user click close? if( m_externalWindow.WasClosed() ) { SetWindowDockMode( WindowMode_Docked ); } } } Now the issue is, I can see my test button in the separate window but not the "content". What could be the issue here? Note: The same logic use to work with Unigine 1
silent Posted February 20, 2017 Posted February 20, 2017 Priyank, Could you please provide a small test scene on a newly created UnigineScript project? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Priyank.Jain2 Posted February 20, 2017 Author Posted February 20, 2017 I will try to do that. It will take some time. But, Do you see anything missed in above snippet? Is there something changed with respect to InterfaceWindow in Unigine 2 (may be some refresh call) ?
silent Posted February 20, 2017 Posted February 20, 2017 Priyank, There was several bug fixes for the Interface plugin / widgets long time ago. It's hard to say what exactly causing such issue without a debugging - that's why we need a small test scene. Btw, you are using 2.3.1 SDK? How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Priyank.Jain2 Posted February 22, 2017 Author Posted February 22, 2017 Yes we are using 2.3.1 The issue was with the the setPosition call. Now we need explicitly set it every time before the arrange() call.
Recommended Posts