From 8f5bce64e022d574d61049a40a3bc3bb8a379e69 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 17 Feb 2011 06:46:09 +0000 Subject: [PATCH] patch applied with thanks, fixes #10524 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/stattext.mm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/osx/cocoa/stattext.mm b/src/osx/cocoa/stattext.mm index 42e5c85254..57ba5c4069 100644 --- a/src/osx/cocoa/stattext.mm +++ b/src/osx/cocoa/stattext.mm @@ -44,6 +44,25 @@ } } +- (void) setEnabled:(BOOL) flag +{ + [super setEnabled: flag]; + + if (![self drawsBackground]) { + // Static text is drawn incorrectly when disabled. + // For an explanation, see + // http://www.cocoabuilder.com/archive/message/cocoa/2006/7/21/168028 + if (flag) + { + [self setTextColor: [NSColor controlTextColor]]; + } + else + { + [self setTextColor: [NSColor secondarySelectedControlColor]]; + } + } +} + @end class wxStaticTextCocoaImpl : public wxWidgetCocoaImpl -- 2.47.2