]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for wxSYS_COLOUR_LISTBOX colour detection
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 20 Aug 2001 14:46:09 +0000 (14:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 20 Aug 2001 14:46:09 +0000 (14:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/settings.cpp
src/gtk1/settings.cpp

index ac4b1ef49475b72fb63b098122496d9560514c22..73ad0b87b3fcebe9d5a70f567927b4518f48fc83 100644 (file)
@@ -1,10 +1,10 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        settings.cpp
+// Name:        gtk/settings.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
-// Licence:       wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 
@@ -106,9 +106,13 @@ static bool GetColourFromGTKWidget(GtkWidgetType type, GtkStateType state,
     bool ok;
     if ( def )
     {
-        red = def->bg[state].red;
-        green = def->bg[state].green;
-        blue = def->bg[state].blue;
+        // ok, it's a hack: we really should have different functions to
+        // access GtkStyle::bg and ::base but as we only use base for listbox
+        // for now, this code works too
+        GdkColor *col = type == GTK_BUTTON ? def->bg : def->base;
+        red = col[state].red;
+        green = col[state].green;
+        blue = col[state].blue;
 
         ok = TRUE;
     }
index ac4b1ef49475b72fb63b098122496d9560514c22..73ad0b87b3fcebe9d5a70f567927b4518f48fc83 100644 (file)
@@ -1,10 +1,10 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        settings.cpp
+// Name:        gtk/settings.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
-// Licence:       wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 
@@ -106,9 +106,13 @@ static bool GetColourFromGTKWidget(GtkWidgetType type, GtkStateType state,
     bool ok;
     if ( def )
     {
-        red = def->bg[state].red;
-        green = def->bg[state].green;
-        blue = def->bg[state].blue;
+        // ok, it's a hack: we really should have different functions to
+        // access GtkStyle::bg and ::base but as we only use base for listbox
+        // for now, this code works too
+        GdkColor *col = type == GTK_BUTTON ? def->bg : def->base;
+        red = col[state].red;
+        green = col[state].green;
+        blue = col[state].blue;
 
         ok = TRUE;
     }