Added test for wxTreeCtrl::GetChildrenCount()

Fixed Reparent (added heaps of debug code for this)
  Small mods to glcanvas


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-10-02 19:43:56 +00:00
parent 1c8515f9ab
commit 5fd11f0971
11 changed files with 85 additions and 14 deletions

View File

@@ -2564,20 +2564,32 @@ bool wxWindow::Reparent( wxWindowBase *newParentBase )
wxWindow *oldParent = m_parent,
*newParent = (wxWindow *)newParentBase;
wxASSERT( GTK_IS_WIDGET(m_widget) );
if ( !wxWindowBase::Reparent(newParent) )
return FALSE;
wxASSERT( GTK_IS_WIDGET(m_widget) );
/* prevent GTK from deleting the widget arbitrarily */
gtk_widget_ref( m_widget );
if (oldParent)
{
gtk_container_remove( GTK_CONTAINER(oldParent->m_wxwindow), m_widget );
}
wxASSERT( GTK_IS_WIDGET(m_widget) );
if (newParent)
{
/* insert GTK representation */
(*(newParent->m_insertCallback))(newParent, this);
}
/* reverse: prevent GTK from deleting the widget arbitrarily */
gtk_widget_unref( m_widget );
return TRUE;
}