Skip to content
Discussion options

You must be logged in to vote

You could add a string property to your AppWindow to store the chosen path there, then read it from there in the on_compress_video callback (or pass it in as parameter). This would have the added benefit, that you can easily display the selected value in the UI.

If you want to avoid doing that you need to code your input in a way that the two closures can both reference the same value. You can do this for example by constructing an Rc<RefCell<Option<PathBuf>>> using Rc::new(RefCell::new(input)), cloning that reference-counted value for each closure, and using .borrow_mut() and .borrow() in the first and last closure respectively.

(Note that I'm still relatively new to Rust, there might be…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by hunger
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