X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2f1ae4143271ae63a17e052a1a471d16e9cd8c44..f87a708b143329a5b7f4e18e88967853c553082d:/src/mac/carbon/stattext.cpp diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index 22653f651e..a99f6c4e69 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -15,6 +15,8 @@ #include "wx/app.h" #include "wx/stattext.h" +#include "wx/dc.h" +#include "wx/dcclient.h" #include @@ -55,8 +57,11 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, void wxStaticText::OnDraw( wxDC &dc ) { + if (m_width <= 0 || m_height <= 0) + return; + PrepareDC(dc); - dc.Clear() ; +// dc.Clear() ; this eventually draws in the wrong background colour (appearance panels) int x = 0 ; int y = 0 ; @@ -254,7 +259,9 @@ void wxStaticText::SetLabel(const wxString& st ) m_label = st ; if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) SetSizeOrDefault() ; - - wxClientDC dc(this); - OnDraw( dc ) ; + + Refresh() ; + MacUpdateImmediately() ; +// wxClientDC dc(this); +// OnDraw( dc ) ; }