GJS Support
What problem did you encounter?
In what part of libhandy did you experience the problem? Note that multiple boxes may be checked.
-
build system -
documentation -
example application -
HdyArrows -
HdyColumn -
HdyDialer -
HdyLeaflet -
somewhere else (please elaborate) HdyTitleBar
What is the actual behaviour?
I try to import an ui file containing the definition of a HdyTitleBar. But got JS ERROR: TypeError: class heritage Handy.HdyTitleBar is not an object or null
. If i leave the template inside the main window.ui, all works fine.
What is the expected behaviour?
File sould be import correctly
How to reproduce?
Create a default gjs project inside gnome. Create a titlebar.ui containing :
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="HdyTitleBar" id="main-menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selection_mode">True</property>
...
</object>
</interface>
and a titlebar.js
const { GObject, Gtk, Handy } = imports.gi;
var Titlebar = GObject.registerClass({
GTypeName: 'Titlebar',
Template: 'resource:///info/scandi/kodimote/ui/titlebar.ui'
}, class Titlebar extends Handy.HdyTitleBar {
});
Import it like this :
var { GObject, Gtk } = imports.gi;
var { Titlebar } = imports.ui.titlebar;
var KodimoteWindow = GObject.registerClass({
GTypeName: 'KodimoteWindow',
Template: 'resource:///info/scandi/kodimote/window.ui'
}, class KodimoteWindow extends Gtk.ApplicationWindow {
_init(application) {
super._init({ application });
this.set_titlebar(new Titlebar());
}
});
Which version did you encounter the bug in?
-
I compiled it myself. If you compiled libhandy from source please provide the git revision via e.g. by running git log -1 --pretty=oneline
and pasting the output below.e92c7a3b6324e3024a3fef501a800b2030f48a3d (HEAD -> master, origin/master, origin/HEAD) paginator: Add 'allow-mouse-drag' property
-
I used the precompiled Debian package (e.g. by running a prebuilt image). Please determine which package you have installed and paste the package status (dpkg -s)
What hardware are you running libhandy on?
-
amd64 qemu image -
Librem5 devkit -
other (please elaborate) PureOS
Releveant logfiles
Please provide relevant logs with G_MESSAGES_DEBUG=all <yourappliation>
I don't know if it's a missing support of HdyTitleBar binding for GJS or a mistake in my use of GJS. Documentation about GJS is very poor.