Hi, its my first time here. I am doing the newcomers tutorial and I found a little bug in the saving files section using Vala language.
The code in the image is wrong because it isn’t an arrow function:
filechooser.response.connect ((dialog, response) {
The correct code woulde be:
private void save_file_dialog (Variant? parameter) {
var filechooser = new Gtk.FileChooserNative ("Save File As",
this,
Gtk.FileChooserAction.SAVE,
"_Save",
"_Cancel");
filechooser.response.connect ((dialog, response) => {
if (response == Gtk.ResponseType.ACCEPT) {
File file = filechooser.get_file ();
this.save_file (file);
}
});
filechooser.show ();
}