diff --git a/include/wx/osx/window.h b/include/wx/osx/window.h index caee9c1659..b192b44b47 100644 --- a/include/wx/osx/window.h +++ b/include/wx/osx/window.h @@ -91,7 +91,8 @@ public: virtual bool SetForegroundColour( const wxColour &colour ) wxOVERRIDE; virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE; - + virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const wxOVERRIDE; + virtual int GetCharHeight() const wxOVERRIDE; virtual int GetCharWidth() const wxOVERRIDE; diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index 9a7bb661e6..b21d2d2e14 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -778,6 +778,13 @@ long style, long extraStyle, const wxString& WXUNUSED(name) ) if ( !(style & wxFRAME_TOOL_WINDOW) ) [m_macWindow setHidesOnDeactivate:NO]; + + if ( GetWXPeer()->GetBackgroundStyle() == wxBG_STYLE_TRANSPARENT ) + { + [m_macWindow setOpaque:NO]; + [m_macWindow setAlphaValue:1.0]; + [m_macWindow setBackgroundColor:[NSColor clearColor]]; + } } void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), WXWindow nativeWindow ) diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index 3f46bca9e2..d8883120ac 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -152,7 +152,8 @@ bool wxNonOwnedWindow::Create(wxWindow *parent, wxWindowCreateEvent event(this); HandleWindowEvent(event); - SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE )); + if ( GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT ) + SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE )); if ( parent ) parent->AddChild(this); diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 8ec3e2500a..a8242fc83c 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -518,6 +518,11 @@ bool wxWindowMac::SetBackgroundStyle(wxBackgroundStyle style) return true; } +bool wxWindowMac::IsTransparentBackgroundSupported(wxString* WXUNUSED(reason)) const +{ + return true; +} + bool wxWindowMac::SetBackgroundColour(const wxColour& col ) { if (m_growBox)