Commit 64e131f2 authored by Matthias Clasen's avatar Matthias Clasen

docs: Improve the GtkVideo gallery image

parent a9f0f18c
docs/reference/gtk/images/video.png

3.55 KB | W: | H:

docs/reference/gtk/images/video.png

11.3 KB | W: | H:

docs/reference/gtk/images/video.png
docs/reference/gtk/images/video.png
docs/reference/gtk/images/video.png
docs/reference/gtk/images/video.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -117,6 +117,13 @@ snapshot_widget (GtkWidget *widget)
return surface;
}
static gboolean
quit_cb (gpointer data)
{
*(gboolean *)data = TRUE;
return G_SOURCE_REMOVE;
}
int
main (int argc, char **argv)
{
......@@ -144,7 +151,15 @@ main (int argc, char **argv)
NULL);
}
//while (1) g_main_context_iteration (NULL, 1);
if (info->wait > 0)
{
gboolean quit = FALSE;
g_timeout_add (info->wait, quit_cb, &quit);
while (!quit)
g_main_context_iteration (NULL, TRUE);
}
surface = snapshot_widget (info->window);
......
......@@ -1099,10 +1099,13 @@ create_video (void)
{
GtkWidget *widget;
GtkWidget *vbox;
WidgetInfo *info;
widget = gtk_video_new_for_filename ("../../demos/gtk-demo/gtk-logo.webm");
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
widget = gtk_video_new_for_filename ("demos/gtk-demo/gtk-logo.webm");
gtk_video_set_autoplay (GTK_VIDEO (widget), TRUE);
gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
gtk_widget_set_valign (widget, GTK_ALIGN_FILL);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
gtk_box_append (GTK_BOX (vbox), widget);
......@@ -1110,7 +1113,10 @@ create_video (void)
add_margin (vbox);
return new_widget_info ("video", vbox, SMALL);
info = new_widget_info ("video", vbox, MEDIUM);
info->wait = 2000;
return info;
}
static WidgetInfo *
......
......@@ -18,6 +18,7 @@ typedef struct WidgetInfo
char *name;
gboolean no_focus;
gboolean include_decorations;
guint wait;
WidgetSize size;
} WidgetInfo;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment