mac_threads/
mac_threads.rs1use dispatch2::run_on_main;
2use native_dialog::DialogBuilder;
3use objc2::MainThreadMarker;
4use objc2_app_kit::{NSApp, NSApplication};
5
6fn main() {
7 std::thread::spawn(|| {
8 println!("Hello from another thread!");
9 let path = DialogBuilder::file().open_single_file().show().unwrap();
10 dbg!(path);
11
12 run_on_main(|mtm| {
13 println!("Stopping the application...");
14 NSApp(mtm).stop(None);
15 });
16 });
17
18 println!("Running the application...");
19 NSApplication::main(MainThreadMarker::new().unwrap())
20}