From 55ca41b1ea89c0e6ccf84973091bea8b936eee06 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 29 Jan 2009 22:32:25 +0000 Subject: [PATCH] Store pointer to owning wxWindow in wxPizza widget git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/private/win_gtk.h | 3 ++- src/gtk/popupwin.cpp | 2 +- src/gtk/toplevel.cpp | 2 +- src/gtk/win_gtk.cpp | 3 ++- src/gtk/window.cpp | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/wx/gtk/private/win_gtk.h b/include/wx/gtk/private/win_gtk.h index f98a775a3d..c1f55a85be 100644 --- a/include/wx/gtk/private/win_gtk.h +++ b/include/wx/gtk/private/win_gtk.h @@ -21,7 +21,7 @@ struct WXDLLIMPEXP_CORE wxPizza enum { BORDER_STYLES = wxBORDER_SIMPLE | wxBORDER_RAISED | wxBORDER_SUNKEN | wxBORDER_THEME }; - static GtkWidget* New(long windowStyle = 0); + static GtkWidget* New(long windowStyle, void *owner); static GType type(); void move(GtkWidget* widget, int x, int y); void scroll(int dx, int dy); @@ -33,6 +33,7 @@ struct WXDLLIMPEXP_CORE wxPizza int m_scroll_y; int m_border_style; bool m_is_scrollable; + void *m_owner; }; #endif // _WX_GTK_PIZZA_H_ diff --git a/src/gtk/popupwin.cpp b/src/gtk/popupwin.cpp index 641a9248ea..dd0fd634e5 100644 --- a/src/gtk/popupwin.cpp +++ b/src/gtk/popupwin.cpp @@ -133,7 +133,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style ) g_signal_connect (m_widget, "delete_event", G_CALLBACK (gtk_dialog_delete_callback), this); - m_wxwindow = wxPizza::New(m_windowStyle); + m_wxwindow = wxPizza::New(m_windowStyle, this); gtk_widget_show( m_wxwindow ); gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow ); diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 8990d42304..b83113197f 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -552,7 +552,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget ); // m_wxwindow is the client area - m_wxwindow = wxPizza::New(); + m_wxwindow = wxPizza::New(0,this); gtk_widget_show( m_wxwindow ); gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow ); diff --git a/src/gtk/win_gtk.cpp b/src/gtk/win_gtk.cpp index 8fb91683eb..13f596d26c 100644 --- a/src/gtk/win_gtk.cpp +++ b/src/gtk/win_gtk.cpp @@ -282,10 +282,11 @@ GType wxPizza::type() return type; } -GtkWidget* wxPizza::New(long windowStyle) +GtkWidget* wxPizza::New(long windowStyle,void* owner) { GtkWidget* widget = GTK_WIDGET(g_object_new(type(), NULL)); wxPizza* pizza = WX_PIZZA(widget); + pizza->m_owner = owner; pizza->m_backing_window = NULL; pizza->m_scroll_x = 0; pizza->m_scroll_y = 0; diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index d6cbbfdc19..7fc84be912 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2113,7 +2113,7 @@ bool wxWindowGTK::Create( wxWindow *parent, #endif - m_wxwindow = wxPizza::New(m_windowStyle); + m_wxwindow = wxPizza::New(m_windowStyle,this); #ifndef __WXUNIVERSAL__ if (HasFlag(wxPizza::BORDER_STYLES)) { -- 2.45.2