mutter/doc/cookbook/examples/script-ui.c
Elliot Smith f9d2310b72 cookbook: Make example code C90 compliant
Modified all cookbook example code to prevent ISO C90 compliance
warnings occurring during compilation.
2010-11-12 10:18:31 +00:00

38 lines
768 B
C

#include <stdlib.h>
#include <clutter/clutter.h>
int
main (int argc, char *argv[])
{
ClutterActor *stage;
ClutterScript *ui;
gchar *filename = "script-ui.json";
GError *error = NULL;
clutter_init (&argc, &argv);
ui = clutter_script_new ();
/* load a JSON file into the script */
clutter_script_load_from_file (ui, filename, &error);
if (error != NULL)
{
g_critical ("Error loading ClutterScript file %s\n%s", filename, error->message);
g_error_free (error);
exit (EXIT_FAILURE);
}
/* retrieve objects from the script */
clutter_script_get_objects (ui,
"stage", &stage,
NULL);
clutter_actor_show (stage);
clutter_main ();
return EXIT_SUCCESS;
}