summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMatthew Allum <mallum@openedhand.com>2008-02-29 00:18:29 +0000
committerMatthew Allum <mallum@openedhand.com>2008-02-29 00:18:29 +0000
commitfa64479b58bef8db3bc12b8c0f33ac1f909d8dfc (patch)
treef215227df81eefab181d2a2fbf7b8cbb9d89891d /examples
parentfb738780180cef2090cc9fcb4dd355da78602290 (diff)
downloadclutter-gtk-fa64479b58bef8db3bc12b8c0f33ac1f909d8dfc.tar.gz
2008-02-29 Matthew Allum <mallum@openedhand.com>
* clutter-gtk.pc.in: * configure.ac: Bump up to unstable 0.7 version and clutter req. * clutter-gtk/gtk-clutter-embed.c: * clutter-gtk/gtk-clutter-embed.h: Add clutter_gtk_init(), as to use new API to share DISPLAY and turn off Clutter 'automatic' event collection. Add methods for; expose - Queue a Clutter redraw. map - set Actor mapped flag. show/hide - Forward to stage also. Minor doc additions. * examples/gtk-clutter-events.c: Add some minor comments re when to call show_all(). * examples/gtk-clutter-test.c: Fix event->actor mapping.
Diffstat (limited to 'examples')
-rw-r--r--examples/gtk-clutter-events.c9
-rw-r--r--examples/gtk-clutter-test.c12
2 files changed, 12 insertions, 9 deletions
diff --git a/examples/gtk-clutter-events.c b/examples/gtk-clutter-events.c
index 6235d99..78aa952 100644
--- a/examples/gtk-clutter-events.c
+++ b/examples/gtk-clutter-events.c
@@ -118,9 +118,8 @@ main (gint argc, gchar **argv)
ClutterColor stage_color = {255, 255, 255, 255};
ClutterColor text_color = {0, 0, 0, 255};
- clutter_init (&argc, &argv);
-
gtk_init (&argc, &argv);
+ gtk_clutter_init (&argc, &argv);
/* Create the inital gtk window and widgets, just like normal */
widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -216,9 +215,13 @@ main (gint argc, gchar **argv)
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
g_signal_connect (button, "value-changed", G_CALLBACK (on_opacity_changed), app);
- clutter_actor_show_all (app->stage);
gtk_widget_show_all (app->window);
+ /* Only show/show_all the stage after parent show. widget_show will call
+ * show on the stage.
+ */
+ clutter_actor_show_all (app->stage);
+
gtk_main ();
return 0;
diff --git a/examples/gtk-clutter-test.c b/examples/gtk-clutter-test.c
index 7ab6df8..173d4e9 100644
--- a/examples/gtk-clutter-test.c
+++ b/examples/gtk-clutter-test.c
@@ -28,14 +28,14 @@ input_cb (ClutterStage *stage,
{
if (event->type == CLUTTER_BUTTON_PRESS)
{
- ClutterActor *actor;
+ ClutterActor *a;
gint x, y;
clutter_event_get_coords (event, &x, &y);
- actor = clutter_stage_get_actor_at_pos (stage, x, y);
- if (actor)
- clutter_actor_hide (actor);
+ a = clutter_stage_get_actor_at_pos (stage, x, y);
+ if (a && (CLUTTER_IS_TEXTURE (a) || CLUTTER_IS_CLONE_TEXTURE (a)))
+ clutter_actor_hide (a);
}
else if (event->type == CLUTTER_KEY_PRESS)
{
@@ -114,8 +114,8 @@ main (int argc, char *argv[])
SuperOH *oh;
gint i;
- clutter_init (&argc, &argv);
gtk_init (&argc, &argv);
+ gtk_clutter_init (&argc, &argv);
pixbuf = gdk_pixbuf_new_from_file ("redhand.png", NULL);
@@ -198,7 +198,7 @@ main (int argc, char *argv[])
/* Add the group to the stage */
clutter_group_add (CLUTTER_GROUP (stage), CLUTTER_ACTOR(oh->group));
- /* Show everying ( and map window ) */
+ /* Show our group, widget show will show the stage */
clutter_actor_show_all (CLUTTER_ACTOR (oh->group));
g_signal_connect (stage, "button-press-event",