azul_widgets/
label.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use azul_core::{
    dom::{Dom, DomString},
};

#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub struct Label {
    pub text: DomString,
}

impl Label {

    #[inline]
    pub fn new<S: Into<DomString>>(text: S) -> Self {
        Self { text: text.into() }
    }

    #[inline]
    pub fn dom(self) -> Dom {
        Dom::label(self.text).with_class("__azul-native-label")
    }
}