Make sure there is a valid parent

I _thought_ Detaching removed the parent but turns out not.  Set the
panel to temporary, known-good parent and reparent later after adding
the new page

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21438
This commit is contained in:
Seth Hillbrand 2025-08-06 17:02:51 -07:00
parent 1a8dac9296
commit 8f34543569

View File

@ -421,6 +421,8 @@ void DIALOG_TEMPLATE_SELECTOR::replaceCurrentPage()
if( (unsigned)page < m_panels.size() )
{
m_panels[page]->m_SizerBase->Detach( m_webviewPanel );
m_webviewPanel->Reparent( this ); // Reparent to dialog
m_webviewPanel->Hide(); // Hide webview panel temporarily
}
m_notebook->DeletePage( page );
@ -431,6 +433,7 @@ void DIALOG_TEMPLATE_SELECTOR::replaceCurrentPage()
// Reparent and add webview back to the new panel
m_webviewPanel->Reparent( tpanel );
m_webviewPanel->Show();
tpanel->m_SizerBase->Add( m_webviewPanel, 1, wxEXPAND | wxALL, 5 );
buildPageContent( m_tcTemplatePath->GetValue(), page );