Hello,

when I run the following code and click the close-window icon, I get a bus error:

--- code begins ---

#include <clutter/clutter.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
        clutter_init(&argc, &argv);

        ClutterActor *stage = clutter_stage_get_default ();

        ClutterScript *script = clutter_script_new ();
        GError *error = NULL;
        clutter_script_load_from_file (script, "hello.json", &error);

        if (error)
          {
                g_warning ("Unable to load UI description: %s", error->message);
                g_error_free (error);
          }
        else
          {
                GObject *stage;
        
clutter_script_connect_signals (script, NULL); /* connect the signal handlers */ stage = clutter_script_get_object (script, "main-stage"); /* get the "main-stage" object */
                clutter_actor_show (CLUTTER_ACTOR (stage));
          }

        clutter_main();

    return EXIT_SUCCESS;
}

--- code ends ---

--- hello.json begins ---


{
  "id" : "main-stage",
  "type" : "ClutterStage",
  "color" : "white"
  "width" : 800,
  "height" : 600,
  "title" : "Script demo",
  "children" : [
    {
      "id" : "hello-label",
      "type" : "ClutterText",
      "x" : 400,
      "y" : 300,
      "text" : "Hello, world!",
      "color" : "black",
      "font-name" : "Sans 12px"
    }
  ],
  "signals" : [
    { "name" : "destroy", "handler" : "clutter_main_quit" }
  ]
}

--- json ends ---

Is something wrong with my code or is this a Mac-specific bug?

Thanks.

pr



--
To unsubscribe send a mail to [email protected]

Reply via email to