mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 15:13:13 -04:00
* Upgrade to objc2 v0.4.0 and icrate v0.0.3 * Fix `touchBar` method * Use ClassType::alloc * Use #[method_id(...)] functionality in declare_class!
26 lines
557 B
Rust
26 lines
557 B
Rust
use icrate::Foundation::NSObject;
|
|
use objc2::rc::Id;
|
|
use objc2::{extern_class, extern_methods, mutability, ClassType};
|
|
|
|
use super::NSMenuItem;
|
|
|
|
extern_class!(
|
|
#[derive(Debug, PartialEq, Eq, Hash)]
|
|
pub(crate) struct NSMenu;
|
|
|
|
unsafe impl ClassType for NSMenu {
|
|
type Super = NSObject;
|
|
type Mutability = mutability::InteriorMutable;
|
|
}
|
|
);
|
|
|
|
extern_methods!(
|
|
unsafe impl NSMenu {
|
|
#[method_id(new)]
|
|
pub fn new() -> Id<Self>;
|
|
|
|
#[method(addItem:)]
|
|
pub fn addItem(&self, item: &NSMenuItem);
|
|
}
|
|
);
|