Last active
July 14, 2017 04:29
-
-
Save ptomato/bb496c99631a3f8d57c2174d82a04ecf to your computer and use it in GitHub Desktop.
Inventing GObject ES6 Classes (2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass extends GObject.Object { | |
static get GTypeName { return 'MyNamespaceMyClass'; } | |
static get Implements { return [Gio.Initable, MyCustomInterface]; } | |
static get Properties { | |
return { | |
'prop': GObject.ParamSpec.int( /* etc., etc. */ ), | |
}; | |
} | |
static get Signals { | |
return { | |
'signal': { /* etc. */ }, | |
}; | |
} | |
constructor(props={}) { | |
super(props); | |
// etc. | |
} | |
get prop() { /* ... */ } | |
method(arg) { /* ... */ } | |
} | |
GObject.registerClass(MyClass); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment