In GJS it's possible to add a XML template to a custom widget, as explained in the documentation.
Luckily, in GJS it is quite simple to load a user interface template
/* imports */
GObject.registerClass({
Template: 'url://templateurl',
InternalChildren: ['button'] // Array of IDs
}, class X extends GObject.Object {
/* implementation */
});
Now you can access the button like this :
this._button.do_something();
This is really useful and lacks in node-gtk, Would it be possible to have a different gi.registerClass, which behave as now when 1 parameter is passed, and behave like described above when 2 are ?
Hello,
In GJS it's possible to add a XML template to a custom widget, as explained in the documentation.
This is really useful and lacks in node-gtk, Would it be possible to have a different
gi.registerClass
, which behave as now when 1 parameter is passed, and behave like described above when 2 are ?