App.prototype.showModal = function() { let label, modal, contentArea, button, actionArea; label = new Gtk.Label({ label: "Hello 'Modal'!", vexpand: true }); modal = new Gtk.Dialog({ defaultHeight: 200, defaultWidth: 200, modal: true, transientFor: this.window, title: 'Modal', useHeaderBar: false }); modal.on('response', modal.destroy); contentArea = modal.getContentArea(); contentArea.add(label); button = Gtk.Button.newWithLabel ('OK'); button.on("clicked", () => { print('OK pressed'); modal.destroy(); }); actionArea = modal.getActionArea(); actionArea.add(button); modal.showAll(); };