use objc::{msg_send, sel, sel_impl};
use crate::{foundation::NSString, objective_c_runtime::traits::FromId, object};
use super::{interface_impl, INSControl, INSResponder, INSView};
object! {
unsafe pub struct NSTextField;
}
impl INSResponder for NSTextField {}
impl INSView for NSTextField {}
impl INSControl for NSTextField {}
#[interface_impl(NSControl)]
impl NSTextField {
#[method]
pub fn label_with_string(string: NSString) -> Self
where
Self: Sized + FromId,
{
unsafe { Self::from_id(msg_send![Self::m_class(), labelWithString: string]) }
}
#[method]
pub fn text_field_with_string(string: NSString) -> Self
where
Self: Sized + FromId,
{
unsafe { Self::from_id(msg_send![Self::m_class(), textFieldWithString: string]) }
}
#[method]
pub fn text_view_with_string(string: NSString) -> Self
where
Self: Sized + FromId,
{
unsafe { Self::from_id(msg_send![Self::m_class(), textViewWithString: string]) }
}
}