]> Pileus Git - ~andy/gtk/blobdiff - tests/testcombo.c
stylecontext: Do invalidation on first resize container
[~andy/gtk] / tests / testcombo.c
index b1bb7f94ba15011d55ed992af1ad7cc2f5e6fed3..9a80ed32e18530a8e1d8d214ad62d6bfe2ad978a 100644 (file)
@@ -12,9 +12,7 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 #include "config.h"
 #include <gtk/gtk.h>
@@ -31,13 +29,13 @@ static GdkPixbuf *
 create_color_pixbuf (const char *color)
 {
         GdkPixbuf *pixbuf;
-        GdkColor col;
+        GdkRGBA rgba;
 
         int x;
         int num;
         guchar *pixels, *p;
 
-        if (!gdk_color_parse (color, &col))
+        if (!gdk_rgba_parse (&rgba, color))
                 return NULL;
 
         pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
@@ -50,9 +48,9 @@ create_color_pixbuf (const char *color)
                 gdk_pixbuf_get_height (pixbuf);
 
         for (x = 0; x < num; x++) {
-                p[0] = col.red / 65535 * 255;
-                p[1] = col.green / 65535 * 255;
-                p[2] = col.blue / 65535 * 255;
+                p[0] = rgba.red * 255;
+                p[1] = rgba.green * 255;
+                p[2] = rgba.blue * 255;
                 p += 3;
         }
 
@@ -1092,7 +1090,7 @@ main (int argc, char **argv)
         GtkTreeModel *model;
        GtkTreePath *path;
        GtkTreeIter iter;
-        GdkColor color;
+       GdkRGBA color;
        GtkCellArea *area;
 
         gtk_init (&argc, &argv);
@@ -1285,10 +1283,11 @@ main (int argc, char **argv)
         gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (tmp), renderer,
                                         "text", 1,
                                         NULL);
-        color.red = 0xffff;
-        color.blue = 0xffff;
+        color.red = 1.0;
+        color.blue = 1.0;
         color.green = 0;
-        gtk_cell_view_set_background_color (GTK_CELL_VIEW (tmp), &color);
+        color.alpha = 1.0;
+        gtk_cell_view_set_background_rgba (GTK_CELL_VIEW (tmp), &color);
         displayed_row_changed (GTK_COMBO_BOX (combobox), GTK_CELL_VIEW (tmp));
         g_signal_connect (combobox, "changed", G_CALLBACK (displayed_row_changed), tmp);