Hello,
I created a widget in an extension (the prefs.js), then register a custom widget that extends Gtk.Box (the snippet below). But then an exception of TypeError: this.add is not a function
is thrown.
I wonder if some of Gi binding for Gtk.Box is incomplete? I wonder if anyone has a better way debugging this kind of error.
imports.gi.versions.Gtk = "3.0";
const Lang = imports.lang;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const SomeWidget = GObject.registerClass({}, class SomeWidget extends Gtk.Box {
constructor(params) {
super(params);
let stack = new Gtk.Stack({
transition_type: Gtk.StackTransitionType.SLIDE_LEFT_RIGHT,
transition_duration: 500
});
let stack_switcher = new Gtk.StackSwitcher({
stack: stack
});
this.add(stack_switcher);
this.add(stack);
}
}