[tests] Remove compiler warnings
[clutter-gtk] / examples / gtk-clutter-multistage.c
1 #include <gtk/gtk.h>
2 #include <clutter/clutter.h>
3
4 #include <clutter-gtk/clutter-gtk.h>
5
6 int
7 main (int argc, char *argv[])
8 {
9   ClutterActor    *stage1, *stage2, *tex1, *tex2;
10   GtkWidget       *window, *clutter1, *clutter2;
11   GtkWidget       *vbox;
12   ClutterColor     col1 = { 0xff, 0xff, 0xff, 0xff };
13   ClutterColor     col2 = { 0, 0, 0, 0xff };
14
15   if (gtk_clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
16     g_error ("Unable to initialize GtkClutter");
17
18   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
19   g_signal_connect (window, "destroy",
20                     G_CALLBACK (gtk_main_quit), NULL);
21
22   vbox = gtk_vbox_new (FALSE, 6);
23   gtk_container_add (GTK_CONTAINER (window), vbox);
24
25   clutter1 = gtk_clutter_embed_new ();
26   gtk_widget_set_size_request (clutter1, 320, 240);
27   stage1 = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (clutter1));
28   clutter_stage_set_color (CLUTTER_STAGE(stage1), &col1);
29   tex1 = gtk_clutter_texture_new_from_stock (clutter1,
30                                              GTK_STOCK_DIALOG_INFO,
31                                              GTK_ICON_SIZE_DIALOG);
32   clutter_actor_set_anchor_point (tex1,
33                                   clutter_actor_get_width (tex1) / 2,
34                                   clutter_actor_get_height (tex1) / 2);
35   clutter_actor_set_position (tex1, 160, 120);
36   clutter_stage_add (stage1, tex1); 
37   clutter_actor_show (tex1);
38
39   gtk_container_add (GTK_CONTAINER (vbox), clutter1);
40
41   clutter2 = gtk_clutter_embed_new ();
42   gtk_widget_set_size_request (clutter2, 320, 240);
43   stage2 = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (clutter2));
44   clutter_stage_set_color (CLUTTER_STAGE(stage2), &col2);
45   tex2 = gtk_clutter_texture_new_from_icon_name (clutter1,
46                                                  "user-info",
47                                                  GTK_ICON_SIZE_BUTTON);
48   clutter_actor_set_anchor_point (tex2,
49                                   clutter_actor_get_width (tex2) / 2,
50                                   clutter_actor_get_height (tex2) / 2);
51   clutter_actor_set_position (tex2, 160, 120);
52   clutter_stage_add (stage2, tex2);
53
54   gtk_container_add (GTK_CONTAINER (vbox), clutter2);
55
56   gtk_widget_show_all (window);
57   clutter_actor_show_all (stage1); 
58   clutter_actor_show_all (stage2); 
59
60   gtk_main();
61
62   return 0;
63 }