Skip to content

Instantly share code, notes, and snippets.

@ptomato

ptomato/verbose.js

Last active Jul 14, 2017
Embed
What would you like to do?
Inventing GObject ES6 Classes (2)
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