use objc::{msg_send, sel, sel_impl};
use crate::{
core_graphics::CGFloat,
object,
objective_c_runtime::traits::{FromId, PNSObject},
};
use super::{interface_impl, NSStatusItem};
object! {
unsafe pub struct NSStatusBar;
}
#[interface_impl(NSObject)]
impl NSStatusBar {
#[property]
pub fn system_status_bar() -> Self
where
Self: Sized + FromId,
{
unsafe { Self::from_id(msg_send![Self::m_class(), systemStatusBar]) }
}
#[method]
pub fn status_item_with_length(&self, length: CGFloat) -> NSStatusItem {
unsafe { NSStatusItem::from_id(msg_send![self.m_self(), statusItemWithLength: length]) }
}
}