From 97560ce3a45cfa6f726c69acd7d6cfd773032a5e Mon Sep 17 00:00:00 2001 From: "J. Russell Smyth" Date: Mon, 17 May 1999 06:29:39 +0000 Subject: [PATCH] Added code to make wxMDIChildFrame::Activate() work git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2480 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/mdi.cpp | 11 +++++++++++ src/gtk1/mdi.cpp | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/gtk/mdi.cpp b/src/gtk/mdi.cpp index 0753a14aa6..bed9f15c1a 100644 --- a/src/gtk/mdi.cpp +++ b/src/gtk/mdi.cpp @@ -311,6 +311,17 @@ wxMenuBar *wxMDIChildFrame::GetMenuBar() const void wxMDIChildFrame::Activate() { +#if( GTK_MINOR_VERSION>0 ) + wxMDIParentFrame* parent = (wxMDIParentFrame*)GetParent(); + GtkNotebook* notebook = GTK_NOTEBOOK(parent->m_widget); + gint pageno = gtk_notebook_page_num(notebook,m_page->child); + gtk_notebook_set_page(notebook,pageno); +#else + // the only way I can see to do this under gtk+ 1.0.X would + // be to keep track of page numbers, start at first and + // do "next" enough times to get to this page number - messy + // - J. Russell Smyth +#endif } void wxMDIChildFrame::OnActivate( wxActivateEvent &WXUNUSED(event) ) diff --git a/src/gtk1/mdi.cpp b/src/gtk1/mdi.cpp index 0753a14aa6..bed9f15c1a 100644 --- a/src/gtk1/mdi.cpp +++ b/src/gtk1/mdi.cpp @@ -311,6 +311,17 @@ wxMenuBar *wxMDIChildFrame::GetMenuBar() const void wxMDIChildFrame::Activate() { +#if( GTK_MINOR_VERSION>0 ) + wxMDIParentFrame* parent = (wxMDIParentFrame*)GetParent(); + GtkNotebook* notebook = GTK_NOTEBOOK(parent->m_widget); + gint pageno = gtk_notebook_page_num(notebook,m_page->child); + gtk_notebook_set_page(notebook,pageno); +#else + // the only way I can see to do this under gtk+ 1.0.X would + // be to keep track of page numbers, start at first and + // do "next" enough times to get to this page number - messy + // - J. Russell Smyth +#endif } void wxMDIChildFrame::OnActivate( wxActivateEvent &WXUNUSED(event) ) -- 2.45.2