From f96f6a880c6e7127bb9fe7aa7268d984dafdc7af Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 20 Jun 2008 14:41:24 +0000 Subject: [PATCH] don't pass negative height to wxWindow::SetSize(), this results in GTK+ warnings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 30409be22f..990c0b9bff 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2712,16 +2712,23 @@ public: for (i = 0; i < page_count; ++i) { + int height = m_rect.height - m_tab_ctrl_height; + if ( height < 0 ) + { + // avoid passing negative height to wxWindow::SetSize(), this + // results in assert failures/GTK+ warnings + height = 0; + } + wxAuiNotebookPage& page = pages.Item(i); if (m_tabs->GetFlags() & wxAUI_NB_BOTTOM) { - page.window->SetSize(m_rect.x, m_rect.y, - m_rect.width, m_rect.height - m_tab_ctrl_height); + page.window->SetSize(m_rect.x, m_rect.y, m_rect.width, height); } else //TODO: if (GetFlags() & wxAUI_NB_TOP) { page.window->SetSize(m_rect.x, m_rect.y + m_tab_ctrl_height, - m_rect.width, m_rect.height - m_tab_ctrl_height); + m_rect.width, height); } // TODO: else if (GetFlags() & wxAUI_NB_LEFT){} // TODO: else if (GetFlags() & wxAUI_NB_RIGHT){}