From: Robin Dunn Date: Thu, 22 Apr 2004 22:04:24 +0000 (+0000) Subject: SetFont may temporarily rset the background to wxNullColour before X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/57fbd4359a6ef6ea37cd90cb61d6848655cf4899 SetFont may temporarily rset the background to wxNullColour before calling ApplyWidgetStyle, so make sure we don't use an invalid colour. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index e5144820ee..ddf29e51e6 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -4206,7 +4206,7 @@ void wxWindowGTK::SetWidgetStyle() } } - if ( m_hasBgCol ) + if ( m_hasBgCol && m_backgroundColour.Ok() ) { m_backgroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) ); if (m_backgroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)) diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index e5144820ee..ddf29e51e6 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -4206,7 +4206,7 @@ void wxWindowGTK::SetWidgetStyle() } } - if ( m_hasBgCol ) + if ( m_hasBgCol && m_backgroundColour.Ok() ) { m_backgroundColour.CalcPixel( gtk_widget_get_colormap( m_widget ) ); if (m_backgroundColour != wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE))