Skip to content

how to use #23

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

You must be logged in to vote

You need something like this in update:

  if let Some(dialog) = &mut self.open_file_dialog {
    if !dialog.show(ctx).visible() {
      if dialog.selected() {
        if let Some(path) = dialog.path() {
          // Do something with the file path.
          ...
        }
      }
      self.open_file_dialog = None;
    }
  }

Examples

https://github.com/Barugon/cota/blob/3327fba8f673fab8286c9ace0e971126abd91792/src/app.rs#L387
https://github.com/Barugon/fp_app/blob/2bfcd5de4344105a40193b9cc7179066721c89b4/src/app.rs#L425

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Barugon
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 #22 on October 18, 2023 19:49.