Skip to content

How to handle Cancel or X? #26

Answered by Barugon
shevernitskiy asked this question in Q&A
Discussion options

You must be logged in to vote

Something like this:

        match file_dlg.state() {
          egui_file::State::Open => {
            // Dialog is visible.
          }
          egui_file::State::Closed => {
            // Dialog is not visible.
          }
          egui_file::State::Cancelled => {
            // Canceled via cancel button or X button.
            frame.close();
          }
          egui_file::State::Selected => {
            // File (or folder, for DialogType::SelectFolder) was selected.
          }
        }

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@Barugon
Comment options

@Barugon
Comment options

Answer selected by shevernitskiy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #25 on November 10, 2023 00:02.