X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/72cdf4c9b3ce92addf09cfb322f0c19bfb0f8744..7b9da2077d0975db6c965a85c91d5aca671ab5e3:/src/gtk/dcclient.cpp?ds=sidebyside diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index a3ddfa66a0..722c2a664e 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -119,8 +119,8 @@ wxWindowDC::wxWindowDC( wxWindow *window ) wxASSERT_MSG( widget, wxT("DC needs a widget") ); - GtkMyFixed *myfixed = GTK_MYFIXED( widget ); - m_window = myfixed->bin_window; + GtkPizza *pizza = GTK_PIZZA( widget ); + m_window = pizza->bin_window; /* not realized ? */ if (!m_window) @@ -813,12 +813,16 @@ void wxWindowDC::DoGetTextExtent(const wxString &string, wxCoord wxWindowDC::GetCharWidth() const { GdkFont *font = m_font.GetInternalFont( m_scaleY ); + wxCHECK_MSG( font, -1, _T("invalid font") ); + return wxCoord(gdk_string_width( font, "H" ) / m_scaleX); } wxCoord wxWindowDC::GetCharHeight() const { GdkFont *font = m_font.GetInternalFont( m_scaleY ); + wxCHECK_MSG( font, -1, _T("invalid font") ); + return wxCoord((font->ascent + font->descent) / m_scaleY); }