X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d02852036df240b17f3164a940383502829435a4..8bda0ec6a3b0a7852eb0056f20a0dba7b07ea593:/src/gtk/window.cpp diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index fb13c32ec2..eac2874bea 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: src/gtk/window.cpp -// Purpose: +// Purpose: wxWindowGTK implementation // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling, Julian Smart @@ -1958,8 +1958,10 @@ wxWindow *wxWindowBase::DoFindFocus() void wxWindowGTK::AddChildGTK(wxWindowGTK* child) { - /* the window might have been scrolled already, do we - have to adapt the position */ + wxASSERT_MSG(m_wxwindow, "Cannot add a child to a window without a client area"); + + // the window might have been scrolled already, we + // have to adapt the position wxPizza* pizza = WX_PIZZA(m_wxwindow); child->m_x += pizza->m_scroll_x; child->m_y += pizza->m_scroll_y; @@ -2436,7 +2438,10 @@ bool wxWindowGTK::Destroy() void wxWindowGTK::DoMoveWindow(int x, int y, int width, int height) { gtk_widget_set_size_request(m_widget, width, height); + // inform the parent to perform the move + wxASSERT_MSG(m_parent && m_parent->m_wxwindow, + "the parent window has no client area?"); WX_PIZZA(m_parent->m_wxwindow)->move(m_widget, x, y); } @@ -3529,7 +3534,12 @@ bool wxWindowGTK::ScrollPages(int pages) void wxWindowGTK::Refresh(bool WXUNUSED(eraseBackground), const wxRect *rect) { - wxCHECK_RET( (m_widget != NULL), wxT("invalid window") ); + if ( !m_widget ) + { + // it is valid to call Refresh() for a window which hasn't been created + // yet, it simply doesn't do anything in this case + return; + } if (!m_wxwindow) {