Gjs

De Banane Atomic
Aller à la navigationAller à la recherche

Gjs: JavaScript bindings for GNOME libraries

Bash.svg
gjs hello.js
hello.js
print("Hello !!!");
helloWindow.js
const Gtk = imports.gi.Gtk;

// Initialize the gtk
Gtk.init(null, 0);

let mwindow = new Gtk.Window({title : "Hello World!"});
// {type : Gtk.WindowType.TOPLEVEL}
mwindow.connect ("destroy", function(){Gtk.main_quit()});

let label = new Gtk.Label ({label : "Hello World"});
mwindow.add (label);

mwindow.show_all();

Gtk.main();