... | ... | @@ -8,6 +8,8 @@ Object constructors look like JavaScript constructors, and can take a map of pro |
|
|
let actor = new Clutter.Group({ reactive: true, width: 100, height: 100 });
|
|
|
```
|
|
|
|
|
|
> **PC** I'd suggest moving towards examples that aren't Clutter, or taken from GNOME Shell code (e.g. `Big.BoxAlignment`.) The focus should be on GTK and friends, so `Gtk.Label` with some properties might be appropriate here.
|
|
|
|
|
|
### Properties
|
|
|
|
|
|
GObject properties may be retrieved and set using JavaScript property style access. Example:
|
... | ... | @@ -42,10 +44,14 @@ Gtk.WindowType.TOPLEVEL; |
|
|
|
|
|
C structures have JavaScript properties for each member. Generally you should treat these as read-only.
|
|
|
|
|
|
> **PC** I'm not sure it's true anymore that these are read-only. Worth double checking.
|
|
|
|
|
|
## Unions
|
|
|
|
|
|
Unions are currently opaque.
|
|
|
|
|
|
> **PC** I don't think this is true anymore either, though I think they are read-only. Unions are rare anyway.
|
|
|
|
|
|
## Multiple return values (caller-allocates)
|
|
|
|
|
|
For functions which have multiple out parameters, the return values are gathered into an array. Example:
|
... | ... | |