]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dcclient.cpp
wxMSW update for CW, wxMac updated
[wxWidgets.git] / src / gtk / dcclient.cpp
index a3ddfa66a0f5a0300680419112b72aac2cba8347..17d8ea2baa496dd7cf88d63b64cbae9a65994ac9 100644 (file)
 #include "wx/dcmemory.h"
 #include "wx/image.h"
 #include "wx/gtk/win_gtk.h"
-#include <math.h>               // for floating-point functions
 
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
+#include <math.h>               // for floating-point functions
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
 
 //-----------------------------------------------------------------------------
 // local data
@@ -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);
 }