node-gtk
node-gtk copied to clipboard
GTK4 with Adw 1 runs into an error
Hey! I'm making a GTK4 app with Adwaita. However, upon installing and importing GTK4 and Adw, I got greated by an error:
/run/media/adam/Données/Utilisateurs/Adam/Documents/dev/JavaScript/GTK/nyarchupdater/node_modules/node-gtk/lib/bootstrap.js:60
const handlerID = this.connect(event, callback, after)
^
TypeError: Signal callback is not a function
at GtkWindow.on (/run/media/adam/Données/Utilisateurs/Adam/Documents/dev/JavaScript/GTK/nyarchupdater/node_modules/node-gtk/lib/bootstrap.js:60:28)
at Object.<anonymous> (/run/media/adam/Données/Utilisateurs/Adam/Documents/dev/JavaScript/GTK/nyarchupdater/src/index.js:9:5)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:22:47
Process finished with exit code 1
I'm running node 16.20.2 with latest node-gtk. Here is my code:
const gi = require("node-gtk");
const Gtk = gi.require("Gtk", "4.0");
const Adw = gi.require("Adw", "1");
gi.startLoop();
Gtk.init();
const win = new Gtk.Window({ title: "Hello, World!" });
win.on("destroy", Gtk.mainQuit);
win.add(new Gtk.Label({ label: 'Hello Gtk+' }))
win.showAll();
Gtk.main();