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

@@ -270,6 +270,8 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
{
wxASSERT( GTK_IS_WIDGET(child->m_widget) );
if (!parent->m_insertInClientArea)
{
/* these are outside the client area */

View File

@@ -695,6 +695,9 @@ gtk_myfixed_remove (GtkContainer *container,
gtk_widget_unparent (widget);
/* security checks */
g_return_if_fail (GTK_IS_WIDGET (widget));
myfixed->children = g_list_remove_link (myfixed->children, children);
g_list_free (children);
g_free (child);
@@ -702,6 +705,9 @@ gtk_myfixed_remove (GtkContainer *container,
if (was_visible && GTK_WIDGET_VISIBLE (container))
gtk_widget_queue_resize (GTK_WIDGET (container));
/* security checks */
g_return_if_fail (GTK_IS_WIDGET (widget));
break;
}

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;
}