rust_macios/appkit/
ns_status_bar.rs1use objc::{msg_send, sel, sel_impl};
2
3use crate::{
4 core_graphics::CGFloat,
5 object,
6 objective_c_runtime::traits::{FromId, PNSObject},
7};
8
9use super::{interface_impl, NSStatusItem};
10
11object! {
12 unsafe pub struct NSStatusBar;
14}
15
16#[interface_impl(NSObject)]
17impl NSStatusBar {
18 #[property]
23 pub fn system_status_bar() -> Self
24 where
25 Self: Sized + FromId,
26 {
27 unsafe { Self::from_id(msg_send![Self::m_class(), systemStatusBar]) }
28 }
29
30 #[method]
35 pub fn status_item_with_length(&self, length: CGFloat) -> NSStatusItem {
36 unsafe { NSStatusItem::from_id(msg_send![self.m_self(), statusItemWithLength: length]) }
37 }
38}