examples: Fixes for compiling with GTK+ 3.0

camerabing example had a missing ')' and the fix to build against GTK+3
that was introduced in commit 516c977c76
is also applied to the camerabin2 example.

The scaletempo demo was using API which has been removed, so that's
wrapped in a version check.
This commit is contained in:
Arun Raghavan 2011-10-06 23:22:51 +05:30
parent f94236078c
commit 2c4bc6134c
3 changed files with 7 additions and 1 deletions

View file

@ -276,7 +276,7 @@ my_bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data)
/* FIXME: make sure to get XID in main thread */
gst_x_overlay_set_window_handle (GST_X_OVERLAY (message->src),
#if GTK_CHECK_VERSION (2, 91, 6)
GDK_WINDOW_XID (gtk_widget_get_window (ui_drawing));
GDK_WINDOW_XID (gtk_widget_get_window (ui_drawing)));
#else
GDK_WINDOW_XWINDOW (gtk_widget_get_window (ui_drawing)));
#endif

View file

@ -98,7 +98,11 @@ bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data)
/* FIXME: make sure to get XID in main thread */
ui_drawing = GTK_WIDGET (gtk_builder_get_object (builder, "viewfinderArea"));
gst_x_overlay_set_window_handle (GST_X_OVERLAY (message->src),
#if GTK_CHECK_VERSION (2, 91, 6)
GDK_WINDOW_XID (gtk_widget_get_window (ui_drawing)));
#else
GDK_WINDOW_XWINDOW (gtk_widget_get_window (ui_drawing)));
#endif
gst_message_unref (message);
return GST_BUS_DROP;

View file

@ -1035,8 +1035,10 @@ demo_gui_show_func (DemoGui * gui)
seek_range =
gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 5.0,
30.0, 0.00)));
#if !GTK_CHECK_VERSION (3, 0, 0)
gtk_range_set_update_policy (GTK_RANGE (seek_range),
GTK_UPDATE_DISCONTINUOUS);
#endif
seek_bar = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (seek_bar), amount_played, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (seek_bar), seek_range, TRUE, TRUE, 2);