]> Pileus Git - ~andy/gtk/blobdiff - tests/testtreemenu.c
stylecontext: Do invalidation on first resize container
[~andy/gtk] / tests / testtreemenu.c
index 9e223671baa9fa33d11d4818bc642e9da41d6b69..1e8443abc2b429e555374a9df6c5b08f0e960555 100644 (file)
@@ -1,5 +1,4 @@
 #include <gtk/gtk.h>
-#include "cellareascaffold.h"
 
 
 /*******************************************************
@@ -11,14 +10,14 @@ static GdkPixbuf *
 create_color_pixbuf (const char *color)
 {
   GdkPixbuf *pixbuf;
-  GdkColor col;
+  GdkRGBA rgba;
 
   int x;
   int num;
   int rowstride;
   guchar *pixels, *p;
   
-  if (!gdk_color_parse (color, &col))
+  if (!gdk_rgba_parse (color, &col))
     return NULL;
   
   pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
@@ -32,9 +31,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] = col.red * 255;
+    p[1] = col.green * 255;
+    p[2] = col.blue * 255;
     p += 3;
   }
   
@@ -425,7 +424,7 @@ static void
 tree_menu (void)
 {
   GtkWidget *window, *widget;
-  GtkWidget *menu, *menubar, *vbox, *menuitem;
+  GtkWidget *menubar, *vbox;
   GtkCellArea *area;
   GtkTreeModel *store;
 
@@ -433,7 +432,7 @@ tree_menu (void)
 
   gtk_window_set_title (GTK_WINDOW (window), "GtkTreeMenu");
 
-  vbox  = gtk_vbox_new (FALSE, 4);
+  vbox  = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
   gtk_widget_show (vbox);
 
   menubar = gtk_menu_bar_new ();