Commit Graph

7 Commits

Author SHA1 Message Date
Elliot Smith
6c40b10083 cookbook: Added recipe for signal handling in ClutterScript
Added a recipe explaining how to connect signals to handlers
in the JSON definition used by ClutterScript; also shows
how to connect the signals in code once the JSON has been
loaded.

Includes guidelines on writing handlers (i.e. need to use
-export-dynamic and non-static functions) and example
which connects a handler for motion events on a rectangle.
2010-08-31 14:39:47 +01:00
Elliot Smith
79a4dbb329 cookbook: Use nicknames for enumeration values
GEnum nicknames can be used to set properties in JSON
definitions, so added a callout to the JSON example explaining
this, and showing how to derive the nickname for an enumeration
value.

Modified the example code to use nicknames as well.
2010-08-27 15:29:15 +01:00
Elliot Smith
2c3ca20cdc cookbook: Don't use the default stage
It's not necessary to use the default stage, so
don't encourage this in the JSON example.
2010-08-27 15:13:28 +01:00
Elliot Smith
6db795baf6 cookbook: Mention nick names as possible values for enums
As JSON can make use of nicknames for GEnum properties,
mentioned this in the table mapping C property values
to their JSON equivalents (as the nick name is a much
shorter and cleaner way of setting a property in JSON).
2010-08-27 15:10:17 +01:00
Elliot Smith
b532f95917 cookbook: Added introduction to and recipe on ClutterScript
Wrote an introduction to using ClutterScript with JSON. Focus
is on explaining why you might want to use it, basic principles
of operation (with annotated JSON sample), and how to map
data types from C to JSON.

Written simultaneously with a short recipe (uses the same sample
code) showing how to load a JSON file and retrieve objects
from it in code.
2010-08-27 11:25:40 +01:00
Elliot Smith
0fc1c8503b cookbook: Added first draft of script introduction
New script chapter needs an introduction.

While writing the introduction, also slightly changed the
emphasis of the recipe (towards refactoring an existing
application to use ClutterScript) and incorporated example
code into documentation.
2010-08-27 11:21:30 +01:00
Elliot Smith
fef53e1b28 cookbook: Added skeleton for script chapter of cookbook 2010-08-27 11:21:30 +01:00