we are creating an extension, below is the code for a Gtk.Entry that takes the input.
However after we finish writing the text we want to, we are not able to exit with a ‘tab’ key or ‘return’.
Is it possible to exit the box or close the window on 'tab press or return ‘key’ press?
addTextUrl() {
let hbox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL, margin_top: 5 });
this.entry = new Gtk.Entry({ hexpand: true, margin_start: 20 });
this.entry.set_placeholder_text("type your 'One Thing' here.")
this.entry.set_text(this._settings.get_string('text'));
this.entry.connect('changed', (entry) => {
this._settings.set_string('text', entry.get_text());
});
hbox.append(this.entry);
return hbox;
}