]> git.saurik.com Git - wxWidgets.git/commitdiff
don't pass negative height to wxWindow::SetSize(), this results in GTK+ warnings
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 20 Jun 2008 14:41:24 +0000 (14:41 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 20 Jun 2008 14:41:24 +0000 (14:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/aui/auibook.cpp

index 30409be22fa7e485d1c3dafa36420d6d792e0a9a..990c0b9bffdb7ace8bb5a51c3e05e45b930a8e0d 100644 (file)
@@ -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){}