Skip to content

Instantly share code, notes, and snippets.

@ptomato
Last active July 14, 2017 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptomato/2f9483c34ce33b9b83edd680a4595034 to your computer and use it in GitHub Desktop.
Save ptomato/2f9483c34ce33b9b83edd680a4595034 to your computer and use it in GitHub Desktop.
Inventing GObject ES6 Classes (3)
@GObject.Class('MyNamespaceMyClass')
@GObject.implements([Gio.Initable, MyCustomInterface])
@GObject.signal('signal', { /* etc. */ })
class MyClass extends GObject.Object {
    constructor(props={}) {
super(props);
// etc.
}
 
    @GObject.property.int('Short name', 'Blurb', GObject.ParamFlags.READABLE, 42)
    get prop() { /* etc. */ }
 
    method(arg) { /* etc. */ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment