X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bf9a1615ed0d4a051d6165014c7a0b6636f9ed43..ff42758536f8d573409bf6c35528497ba36b4d0e:/src/mac/carbon/listbox.cpp diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index 6697768649..54717cfb18 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -246,6 +246,7 @@ wxSize wxListBox::DoGetBestSize() const { #if wxMAC_USE_CORE_GRAPHICS wxClientDC dc(const_cast(this)); + dc.SetFont(GetFont()); #else wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef)MacGetTopLevelWindowRef() ) ); @@ -288,9 +289,8 @@ wxSize wxListBox::DoGetBestSize() const #else wLine = ::TextWidth( str.c_str(), 0, str.length() ); #endif - - lbWidth = wxMax( lbWidth, wLine ); #endif + lbWidth = wxMax( lbWidth, wLine ); } // Add room for the scrollbar @@ -300,10 +300,10 @@ wxSize wxListBox::DoGetBestSize() const int cy = 12; #if wxMAC_USE_CORE_GRAPHICS wxCoord width, height ; - dc.GetTextExtent( wxT("X") , &width, &height); + dc.GetTextExtent( wxT("XX") , &width, &height); int cx = width ; #else - int cx = ::TextWidth( "X", 0, 1 ); + int cx = ::TextWidth( "XX", 0, 1 ); #endif lbWidth += cx;