From: Robin Dunn Date: Fri, 18 Jun 2004 17:30:32 +0000 (+0000) Subject: Give wxWindowGTK::ApplyWidgetStyle an implementation too so X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f8e045e24bb7f37af742fe6afb4a454fc900bfe5 Give wxWindowGTK::ApplyWidgetStyle an implementation too so non-control windows can also change colours, etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index e9310bd3aa..045dbfc9fa 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -145,7 +145,7 @@ extern GtkContainerClass *pizza_parent_class; thw wxWindow class has a member variable called m_widget which holds a pointer to this widget. When the window class represents a GTK native widget, this is (in most cases) the only GTK widget the class manages. E.g. the - wxStatitText class handles only a GtkLabel widget a pointer to which you + wxStaticText class handles only a GtkLabel widget a pointer to which you can find in m_widget (defined in wxWindow) When the class has a client area for drawing into and for containing children @@ -4085,8 +4085,18 @@ GtkRcStyle *wxWindowGTK::CreateWidgetStyle(bool forceStyle) return style; } -void wxWindowGTK::ApplyWidgetStyle(bool WXUNUSED(forceStyle)) +void wxWindowGTK::ApplyWidgetStyle(bool forceStyle) { + GtkRcStyle *style = CreateWidgetStyle(forceStyle); + if ( style ) + { + if (m_wxwindow) + // should we also do m_widget in this case? + gtk_widget_modify_style(m_wxwindow, style); + else + gtk_widget_modify_style(m_widget, style); + gtk_rc_style_unref(style); + } } //----------------------------------------------------------------------------- diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index e9310bd3aa..045dbfc9fa 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -145,7 +145,7 @@ extern GtkContainerClass *pizza_parent_class; thw wxWindow class has a member variable called m_widget which holds a pointer to this widget. When the window class represents a GTK native widget, this is (in most cases) the only GTK widget the class manages. E.g. the - wxStatitText class handles only a GtkLabel widget a pointer to which you + wxStaticText class handles only a GtkLabel widget a pointer to which you can find in m_widget (defined in wxWindow) When the class has a client area for drawing into and for containing children @@ -4085,8 +4085,18 @@ GtkRcStyle *wxWindowGTK::CreateWidgetStyle(bool forceStyle) return style; } -void wxWindowGTK::ApplyWidgetStyle(bool WXUNUSED(forceStyle)) +void wxWindowGTK::ApplyWidgetStyle(bool forceStyle) { + GtkRcStyle *style = CreateWidgetStyle(forceStyle); + if ( style ) + { + if (m_wxwindow) + // should we also do m_widget in this case? + gtk_widget_modify_style(m_wxwindow, style); + else + gtk_widget_modify_style(m_widget, style); + gtk_rc_style_unref(style); + } } //-----------------------------------------------------------------------------