Skip to content

Instantly share code, notes, and snippets.

@ptomato

ptomato/legacy.js

Last active Jul 14, 2017
Embed
What would you like to do?
Inventing GObject ES6 Classes (1)
const MyClass = new Lang.Class({
    Name: 'MyClass',
    GTypeName: 'MyNamespaceMyClass',
    Extends: GObject.Object,
    Implements: [Gio.Initable, MyCustomInterface],
    Properties: {
        'prop': GObject.ParamSpec.int( /* etc., etc. */ ),
    },
    Signals: {
        'signal': { param_types: [ /* etc., etc. */ ] },
    },
    _init(props={}) {
        this.parent(props);
        // etc.
    },
get prop() { /* ... */ },
method(arg) { /* ... */ },
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment