use crate::prelude::*;
impl Ui {
pub fn create_label<'ui>(
&'ui self,
text: impl Into<Vec<u8>>,
) -> Result<&'ui mut Label, crate::Error> {
let text = self.make_cstring(text)?;
unsafe { call_libui_new_fn!(ui: self, fn: uiNewLabel(text.as_ptr()) -> Label) }
}
}
#[subcontrol(handle = "uiLabel")]
pub struct Label;
impl Label<'_> {
#[bind_text(fn = "uiLabelText")]
pub fn text(&self) -> _;
pub fn set_text(&self, text: impl Into<Vec<u8>>) -> Result<(), crate::Error> {
let text = self.ui.make_cstring(text)?;
unsafe { uiLabelSetText(self.as_ptr(), text.as_ptr()) };
Ok(())
}
}