examples: Make demos -DSEAL safe to fix build with GTK+ 3.0
authorGuido Günther <agx@sigxcpu.org>
Sat, 26 Jun 2010 18:12:25 +0000 (20:12 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sun, 27 Jun 2010 05:28:22 +0000 (07:28 +0200)
tests/examples/equalizer/demo.c
tests/examples/spectrum/demo-audiotest.c
tests/examples/spectrum/demo-osssrc.c

index f5b1ec58b707d5a6e52c2a2fc2b3caf24d313238..9b365ee23b101b1fc59a13b5922af663f126c678 100644 (file)
@@ -83,14 +83,16 @@ draw_spectrum (gfloat * data)
   if (!drawingarea)
     return;
 
-  gdk_window_begin_paint_rect (drawingarea->window, &rect);
-  gdk_draw_rectangle (drawingarea->window, drawingarea->style->black_gc,
+  gdk_window_begin_paint_rect (gtk_widget_get_window (drawingarea), &rect);
+  gdk_draw_rectangle (gtk_widget_get_window (drawingarea),
+      gtk_widget_get_style (drawingarea)->black_gc,
       TRUE, 0, 0, spect_bands, spect_height);
   for (i = 0; i < spect_bands; i++) {
-    gdk_draw_rectangle (drawingarea->window, drawingarea->style->white_gc,
+    gdk_draw_rectangle (gtk_widget_get_window (drawingarea),
+        gtk_widget_get_style (drawingarea)->white_gc,
         TRUE, i, -data[i], 1, spect_height + data[i]);
   }
-  gdk_window_end_paint (drawingarea->window);
+  gdk_window_end_paint (gtk_widget_get_window (drawingarea));
 }
 
 /* receive spectral data from element message */
index a4dc1c30923e878e4a2c375ff08ead67af9630c1..094ab316842d45f1941579b80f3e883ced7edec1 100644 (file)
@@ -82,14 +82,16 @@ draw_spectrum (gfloat * data)
   if (!drawingarea)
     return;
 
-  gdk_window_begin_paint_rect (drawingarea->window, &rect);
-  gdk_draw_rectangle (drawingarea->window, drawingarea->style->black_gc,
+  gdk_window_begin_paint_rect (gtk_widget_get_window (drawingarea), &rect);
+  gdk_draw_rectangle (gtk_widget_get_window (drawingarea),
+      gtk_widget_get_style (drawingarea)->black_gc,
       TRUE, 0, 0, spect_bands, spect_height);
   for (i = 0; i < spect_bands; i++) {
-    gdk_draw_rectangle (drawingarea->window, drawingarea->style->white_gc,
+    gdk_draw_rectangle (gtk_widget_get_window (drawingarea),
+        gtk_widget_get_style (drawingarea)->white_gc,
         TRUE, i, -data[i], 1, spect_height + data[i]);
   }
-  gdk_window_end_paint (drawingarea->window);
+  gdk_window_end_paint (gtk_widget_get_window (drawingarea));
 }
 
 /* process delayed message */
index b4b66bb0bfbecfe76ffa623aa320f039baaa0b4a..091e4b2e0e8b2b52009635016109866c3c0d97fd 100644 (file)
@@ -71,14 +71,16 @@ draw_spectrum (gfloat * data)
   if (!drawingarea)
     return;
 
-  gdk_window_begin_paint_rect (drawingarea->window, &rect);
-  gdk_draw_rectangle (drawingarea->window, drawingarea->style->black_gc,
+  gdk_window_begin_paint_rect (gtk_widget_get_window (drawingarea), &rect);
+  gdk_draw_rectangle (gtk_widget_get_window (drawingarea),
+      gtk_widget_get_style (drawingarea)->black_gc,
       TRUE, 0, 0, spect_bands, spect_height);
   for (i = 0; i < spect_bands; i++) {
-    gdk_draw_rectangle (drawingarea->window, drawingarea->style->white_gc,
+    gdk_draw_rectangle (gtk_widget_get_window (drawingarea),
+        gtk_widget_get_style (drawingarea)->white_gc,
         TRUE, i, -data[i], 1, spect_height + data[i]);
   }
-  gdk_window_end_paint (drawingarea->window);
+  gdk_window_end_paint (gtk_widget_get_window (drawingarea));
 }
 
 /* process delayed message */