bors-servo e9a65bb15d Auto merge of #454 - zed-industries:nsopenpanel, r=jdm
Add bindings for NSOpenPanel

This PR adds bindings for the main `NSOpenPanel` APIs, which let you present a modal for selecting files or directories. Usage:

```rust
let panel = NSOpenPanel::openPanel(nil);
panel.setCanChooseDirectories_(YES);
panel.setCanChooseFiles_(NO);
panel.setAllowsMultipleSelection_(YES);

let response = panel.runModal();
if response == NSModalResponse::NSModalResponseOk {
    let urls = panel.URLs();
    for i in 0..urls.count() {
        let url_ptr = urls.objectAtIndex(i).absoluteString().UTF8String();
        let url = CStr::from_ptr(url_ptr).to_string_lossy();
        eprintln!("You picked URL {}", url);
    }
}
```
2021-04-09 09:38:42 -04:00
2021-04-08 21:59:54 -07:00
2021-02-14 11:52:04 -05:00
2021-02-14 11:52:04 -05:00
2021-02-14 12:05:14 -05:00
2020-10-26 13:38:20 -04:00
2020-07-17 22:48:21 -04:00
2013-04-04 19:01:35 -07:00
2013-04-03 18:18:52 -07:00
2013-04-03 18:18:52 -07:00
2019-07-14 21:16:49 -07:00

core-foundation-rs

Build Status

Compatibility

Targets macOS 10.7 by default.

To enable features added in macOS 10.8, set Cargo feature mac_os_10_8_features. To have both 10.8 features and 10.7 compatibility, also set mac_os_10_7_support. Setting both requires weak linkage, which is a nightly-only feature as of Rust 1.19.

For more experimental but more complete, generated bindings take a look at https://github.com/michaelwu/RustKit.

S
Description
No description provided
Readme 2.5 MiB
Languages
Rust 100%