2007-10-27 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/clutter-script.[ch]: Slight API change in the
	clutter_script_get_objects() function: now it takes
	object name/object return location pairs and returns the
	number of objects found and returned.

	* tests/test-script.c: Exercise the clutter_script_get_objects()
	function.
This commit is contained in:
Emmanuele Bassi
2007-10-27 19:08:59 +00:00
parent ae7463cccf
commit 35132fb5de
4 changed files with 52 additions and 18 deletions

View File

@ -96,6 +96,7 @@ main (int argc, char *argv[])
{
GObject *stage, *timeline, *blue_button, *red_button;
GError *error = NULL;
gint res;
clutter_init (&argc, &argv);
@ -132,16 +133,20 @@ main (int argc, char *argv[])
return EXIT_FAILURE;
}
stage = clutter_script_get_object (script, "main-stage");
res = clutter_script_get_objects (script,
"main-stage", &stage,
"red-button", &red_button,
"blue-button", &blue_button,
NULL);
g_assert (res == 3);
clutter_actor_show (CLUTTER_ACTOR (stage));
red_button = clutter_script_get_object (script, "red-button");
g_signal_connect (red_button,
"button-press-event",
G_CALLBACK (red_button_press),
NULL);
blue_button = clutter_script_get_object (script, "blue-button");
g_signal_connect (blue_button,
"button-press-event",
G_CALLBACK (blue_button_press),