summaryrefslogtreecommitdiff
authorRobert Staudinger <robsta@gnome.org>2009-08-11 08:44:21 (GMT)
committer Robert Staudinger <robsta@gnome.org>2009-08-11 08:44:21 (GMT)
commitd3897522bfa7a420fed80357fe572d8ca61e4c20 (patch) (side-by-side diff)
tree2fba7b21c9df34223a014ae2e061f652d25d736a
parent14ba6f1bcbd504adab04812b8832457847f77cf1 (diff)
downloadccss-d3897522bfa7a420fed80357fe572d8ca61e4c20.zip
ccss-d3897522bfa7a420fed80357fe572d8ca61e4c20.tar.gz
[examples] Use drawing-area so resizing the window works.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--examples/example-2.c7
-rw-r--r--examples/example-3.c7
-rw-r--r--examples/example-4-1.c7
-rw-r--r--examples/example-4-2.c7
-rw-r--r--examples/example-4.c7
-rw-r--r--examples/example-5.c7
-rw-r--r--examples/example-8.c1
7 files changed, 30 insertions, 13 deletions
diff --git a/examples/example-2.c b/examples/example-2.c
index 088a1cc..fdcd3f7 100644
--- a/examples/example-2.c
+++ b/examples/example-2.c
@@ -76,6 +76,7 @@ main (int argc,
ccss_style_t *style;
node_t node;
GtkWidget *window;
+ GtkWidget *area;
gtk_init (&argc, &argv);
@@ -98,10 +99,12 @@ main (int argc,
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 160, 90);
- gtk_widget_set_app_paintable (window, TRUE);
g_signal_connect (G_OBJECT (window), "delete-event",
G_CALLBACK (gtk_main_quit), NULL);
- g_signal_connect (G_OBJECT (window), "expose-event",
+
+ area = gtk_drawing_area_new ();
+ gtk_container_add (GTK_CONTAINER (window), area);
+ g_signal_connect (G_OBJECT (area), "expose-event",
G_CALLBACK (expose_cb), style);
gtk_widget_show_all (window);
diff --git a/examples/example-3.c b/examples/example-3.c
index ea2a7dd..e073f08 100644
--- a/examples/example-3.c
+++ b/examples/example-3.c
@@ -65,6 +65,7 @@ main (int argc,
ccss_stylesheet_t *stylesheet;
ccss_style_t *style;
GtkWidget *window;
+ GtkWidget *area;
gtk_init (&argc, &argv);
@@ -82,10 +83,12 @@ main (int argc,
#endif
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 160, 90);
- gtk_widget_set_app_paintable (window, TRUE);
g_signal_connect (G_OBJECT (window), "delete-event",
G_CALLBACK (gtk_main_quit), NULL);
- g_signal_connect (G_OBJECT (window), "expose-event",
+
+ area = gtk_drawing_area_new ();
+ gtk_container_add (GTK_CONTAINER (window), area);
+ g_signal_connect (G_OBJECT (area), "expose-event",
G_CALLBACK (expose_cb), style);
gtk_widget_show_all (window);
diff --git a/examples/example-4-1.c b/examples/example-4-1.c
index 2ceede5..fbba760 100644
--- a/examples/example-4-1.c
+++ b/examples/example-4-1.c
@@ -50,6 +50,7 @@ main (int argc,
ccss_stylesheet_t *stylesheet;
ccss_style_t *style;
GtkWidget *window;
+ GtkWidget *area;
gtk_init (&argc, &argv);
@@ -66,10 +67,12 @@ main (int argc,
#endif
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 160, 90);
- gtk_widget_set_app_paintable (window, TRUE);
g_signal_connect (G_OBJECT (window), "delete-event",
G_CALLBACK (gtk_main_quit), NULL);
- g_signal_connect (G_OBJECT (window), "expose-event",
+
+ area = gtk_drawing_area_new ();
+ gtk_container_add (GTK_CONTAINER (window), area);
+ g_signal_connect (G_OBJECT (area), "expose-event",
G_CALLBACK (expose_cb), style);
gtk_widget_show_all (window);
diff --git a/examples/example-4-2.c b/examples/example-4-2.c
index 93bf99e..68f22c6 100644
--- a/examples/example-4-2.c
+++ b/examples/example-4-2.c
@@ -85,6 +85,7 @@ main (int argc,
ccss_stylesheet_t *stylesheet;
ccss_style_t *style;
GtkWidget *window;
+ GtkWidget *area;
gtk_init (&argc, &argv);
@@ -101,10 +102,12 @@ main (int argc,
#endif
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 160, 90);
- gtk_widget_set_app_paintable (window, TRUE);
g_signal_connect (G_OBJECT (window), "delete-event",
G_CALLBACK (gtk_main_quit), NULL);
- g_signal_connect (G_OBJECT (window), "expose-event",
+
+ area = gtk_drawing_area_new ();
+ gtk_container_add (GTK_CONTAINER (window), area);
+ g_signal_connect (G_OBJECT (area), "expose-event",
G_CALLBACK (expose_cb), style);
gtk_widget_show_all (window);
diff --git a/examples/example-4.c b/examples/example-4.c
index 48d6580..e287b74 100644
--- a/examples/example-4.c
+++ b/examples/example-4.c
@@ -134,6 +134,7 @@ main (int argc,
ccss_stylesheet_t *stylesheet;
ccss_style_t *style;
GtkWidget *window;
+ GtkWidget *area;
gtk_init (&argc, &argv);
@@ -151,10 +152,12 @@ main (int argc,
#endif
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 160, 90);
- gtk_widget_set_app_paintable (window, TRUE);
g_signal_connect (G_OBJECT (window), "delete-event",
G_CALLBACK (gtk_main_quit), NULL);
- g_signal_connect (G_OBJECT (window), "expose-event",
+
+ area = gtk_drawing_area_new ();
+ gtk_container_add (GTK_CONTAINER (window), area);
+ g_signal_connect (G_OBJECT (area), "expose-event",
G_CALLBACK (expose_cb), style);
gtk_widget_show_all (window);
diff --git a/examples/example-5.c b/examples/example-5.c
index 75f7c77..e4c9e89 100644
--- a/examples/example-5.c
+++ b/examples/example-5.c
@@ -65,6 +65,7 @@ main (int argc,
ccss_stylesheet_t *stylesheet;
ccss_style_t *style;
GtkWidget *window;
+ GtkWidget *area;
gtk_init (&argc, &argv);
@@ -82,10 +83,12 @@ main (int argc,
#endif
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 160, 90);
- gtk_widget_set_app_paintable (window, TRUE);
g_signal_connect (G_OBJECT (window), "delete-event",
G_CALLBACK (gtk_main_quit), NULL);
- g_signal_connect (G_OBJECT (window), "expose-event",
+
+ area = gtk_drawing_area_new ();
+ gtk_container_add (GTK_CONTAINER (window), area);
+ g_signal_connect (G_OBJECT (area), "expose-event",
G_CALLBACK (expose_cb), style);
gtk_widget_show_all (window);
diff --git a/examples/example-8.c b/examples/example-8.c
index 5eb43d5..9e7645b 100644
--- a/examples/example-8.c
+++ b/examples/example-8.c
@@ -103,7 +103,6 @@ main (int argc,
#endif
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 160, 90);
- gtk_widget_set_app_paintable (window, TRUE);
g_signal_connect (G_OBJECT (window), "delete-event",
G_CALLBACK (gtk_main_quit), NULL);