* Upgrade to objc2 v0.4.0 and icrate v0.0.3 * Fix `touchBar` method * Use ClassType::alloc * Use #[method_id(...)] functionality in declare_class!
25 lines
611 B
Rust
25 lines
611 B
Rust
use icrate::Foundation::NSObject;
|
|
use objc2::{extern_class, extern_methods, mutability, ClassType};
|
|
|
|
use super::{NSResponder, NSView};
|
|
|
|
extern_class!(
|
|
#[derive(Debug, PartialEq, Eq, Hash)]
|
|
pub(crate) struct NSControl;
|
|
|
|
unsafe impl ClassType for NSControl {
|
|
#[inherits(NSResponder, NSObject)]
|
|
type Super = NSView;
|
|
type Mutability = mutability::InteriorMutable;
|
|
}
|
|
);
|
|
|
|
extern_methods!(
|
|
unsafe impl NSControl {
|
|
#[method(setEnabled:)]
|
|
pub fn setEnabled(&self, enabled: bool);
|
|
|
|
#[method(isEnabled)]
|
|
pub fn isEnabled(&self) -> bool;
|
|
}
|
|
);
|