]> git.saurik.com Git - wxWidgets.git/commitdiff
build fix for older gtk2, second attempt
authorPaul Cornett <paulcor@bullseye.com>
Sun, 18 Jun 2006 03:37:24 +0000 (03:37 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sun, 18 Jun 2006 03:37:24 +0000 (03:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/colour.h
src/gtk/colour.cpp
src/gtk/cursor.cpp

index 81c00fad7ddb29b2714eded88a0b23c100f6f5fd..26f002d077f14163c28b81731044c9028fc0795b 100644 (file)
@@ -56,7 +56,13 @@ public:
     // Implementation part
     void CalcPixel( GdkColormap *cmap );
     int GetPixel() const;
+#ifdef __WXGTK24__
     const GdkColor *GetColor() const;
+#else
+    // GDK functions from old gtk2 versions take non-const color parameters,
+    // too many uses to deal with individually
+    GdkColor *GetColor() const;
+#endif
 
 protected:
     virtual bool FromString(const wxChar *str);
index afb1cdc00e130600a3e9437957e5a4993f94ba38..594b081506409509d3e14c01e2a4a506d193c516 100644 (file)
@@ -154,7 +154,11 @@ int wxColour::GetPixel() const
     return M_COLDATA->m_color.pixel;
 }
 
+#ifdef __WXGTK24__
 const GdkColor *wxColour::GetColor() const
+#else
+      GdkColor *wxColour::GetColor() const
+#endif
 {
     wxCHECK_MSG( Ok(), NULL, wxT("invalid colour") );
 
index 90d718db89d29417af1f5c77dc785f3932460d44..d02105ec8b92d052e6cce486cf6cd6b792df50a9 100644 (file)
@@ -144,12 +144,7 @@ wxCursor::wxCursor(const char bits[], int width, int  height,
 
     m_refData = new wxCursorRefData;
     M_CURSORDATA->m_cursor = gdk_cursor_new_from_pixmap(
-                 data, mask,
-#if GTK_CHECK_VERSION(2, 6, 0)
-                 fg->GetColor(), bg->GetColor(),
-#else
-                 wx_const_cast(GdkColor*, fg->GetColor()), wx_const_cast(GdkColor*, bg->GetColor()),
-#endif
+                 data, mask, fg->GetColor(), bg->GetColor(),
                  hotSpotX, hotSpotY );
 
     g_object_unref (data);
@@ -300,11 +295,7 @@ wxCursor::wxCursor( const wxImage & image )
                              (
                                 data,
                                 mask,
-#if GTK_CHECK_VERSION(2, 6, 0)
                                 fg.GetColor(), bg.GetColor(),
-#else
-                                wx_const_cast(GdkColor*, fg.GetColor()), wx_const_cast(GdkColor*, bg.GetColor()),
-#endif
                                 hotSpotX, hotSpotY
                              );