[gtk+/wip/gdk-gl: 12/31] tests/glarea: Add a button
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/gdk-gl: 12/31] tests/glarea: Add a button
- Date: Thu, 14 Aug 2014 11:13:19 +0000 (UTC)
commit e18136f16b4a3ca0a698e991ef58d0d853476be0
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Aug 11 21:30:47 2014 +0100
tests/glarea: Add a button
Make the test a bit more friendly.
tests/testglarea.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/tests/testglarea.c b/tests/testglarea.c
index 108dcdf..0acdb60 100644
--- a/tests/testglarea.c
+++ b/tests/testglarea.c
@@ -27,7 +27,7 @@ render (GtkGLArea *area,
int
main (int argc, char *argv[])
{
- GtkWidget *window, *gl_area;
+ GtkWidget *window, *gl_area, *box, *button;
GdkGLPixelFormat *pixel_format;
gtk_init (&argc, &argv);
@@ -44,13 +44,26 @@ main (int argc, char *argv[])
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show (window);
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
+ gtk_box_set_spacing (GTK_BOX (box), 6);
+ gtk_container_add (GTK_CONTAINER (window), box);
+ gtk_widget_show (box);
+
gl_area = gtk_gl_area_new (pixel_format);
- gtk_container_add (GTK_CONTAINER (window), gl_area);
+ gtk_widget_set_hexpand (gl_area, TRUE);
+ gtk_widget_set_vexpand (gl_area, TRUE);
+ gtk_container_add (GTK_CONTAINER (box), gl_area);
gtk_widget_show (gl_area);
g_object_unref (pixel_format);
g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
+ button = gtk_button_new_with_label ("Quit");
+ gtk_widget_set_hexpand (button, TRUE);
+ gtk_container_add (GTK_CONTAINER (box), button);
+ g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
+ gtk_widget_show (button);
+
gtk_main ();
return EXIT_SUCCESS;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]