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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user