and 12 hours later by trial and error I made it work - sure wish there was some web place to teach such basics
const Gtk = imports.gi.Gtk;
Gtk.init(null);
const header = new Gtk.HeaderBar();
header.set_title("GJS");
header.set_subtitle("An app made with GJS");
header.set_show_close_button(true);
const window = new Gtk.Window();
window.window_position = Gtk.WindowPosition.CENTER;
window.connect('destroy', Gtk.main_quit);
window.set_default_size(350, 70);
window.set_titlebar(header);
window.border_width = 10;
// Create the grid
let grid = new Gtk.Grid ();
// Create the widgets inside the grid
let button1 = new Gtk.Button ({ label: "Button 1" });
let button2 = new Gtk.Button ({ label: "Button 2" });
//button1.connect ("clicked", _clickHandler.bind());
// Assemble the grid
window.add (grid);
grid.attach (button1, 1, 1, 1, 1);
grid.attach_next_to (button2, button1, Gtk.PositionType.RIGHT, 1, 1);
//window.add(new Gtk.Button({ label: "Hello GJS" }));
window.show_all ();
Gtk.main();
|