GtkFileDialog throw GError after user pressed ESC or click Cance button?

I’m trying GtkFileDialog with Vala language, I think that GtkFileDialog has better design decision than GtkFileChooserNative and GtkFileChooserDialog, it brings better experiece to user.

Then I found GtkFileDialog will throw GError while user press ESC key or click Cancel button, it’s wired, because the cancel action is done by the user, it should not throw GError.

Yes, that’s somewhat of a blurry line…

That way when the task completes you have a file. To check for the user dismissing the dialog, check for GTK_DIALOG_ERROR_DISMISSED.

See dialog: GTK_DIALOG_ERROR_CANCELLED => GTK_DIALOG_ERROR_DISMISSED (8957302b) · Commits · GNOME / gtk · GitLab

No, that’s not really what a GError means. A GError is an error that is recoverable at run time: it’s like an exception in programming languages that support that construct.

A user cancelling the dialog is perfectly equivalent to some other underlying process that cancels the operation: the file dialog is closed and there’s no selected file at the end.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.