From b8702c673a43e398df644670f4f343cb43df50d0 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 1 Sep 2011 16:20:24 +0000 Subject: [PATCH] fixes #13443, thanks :-) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68967 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/button.mm | 13 ++++++++++--- src/osx/cocoa/window.mm | 6 +++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/osx/cocoa/button.mm b/src/osx/cocoa/button.mm index fa8938295d..3e4288ba8e 100644 --- a/src/osx/cocoa/button.mm +++ b/src/osx/cocoa/button.mm @@ -95,9 +95,16 @@ public: virtual void SetBitmap(const wxBitmap& bitmap) { // switch bezel style for plain pushbuttons - if ( bitmap.IsOk() && [GetNSButton() bezelStyle] == NSRoundedBezelStyle ) - [GetNSButton() setBezelStyle:NSRegularSquareBezelStyle ]; - + if ( bitmap.IsOk() ) + { + if ([GetNSButton() bezelStyle] == NSRoundedBezelStyle) + [GetNSButton() setBezelStyle:NSRegularSquareBezelStyle]; + } + else + { + [GetNSButton() setBezelStyle:NSRoundedBezelStyle]; + } + wxWidgetCocoaImpl::SetBitmap(bitmap); } diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 76fd98719d..26c705fcdd 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -1955,7 +1955,11 @@ void wxWidgetCocoaImpl::SetBitmap( const wxBitmap& bitmap ) { if ( [m_osxView respondsToSelector:@selector(setImage:)] ) { - [m_osxView setImage:bitmap.GetNSImage()]; + if (bitmap.IsOk()) + [m_osxView setImage:bitmap.GetNSImage()]; + else + [m_osxView setImage:nil]; + [m_osxView setNeedsDisplay:YES]; } } -- 2.45.2