pub struct TextInput {
pub state: KeyState,
/* private fields */
}
Fields§
§state: KeyState
Implementations§
Source§impl TextInput
impl TextInput
Sourcepub fn new(
color: Color,
rect: Rect,
corner_radius: Option<u32>,
text_style: Option<Text>,
) -> Self
pub fn new( color: Color, rect: Rect, corner_radius: Option<u32>, text_style: Option<Text>, ) -> Self
Examples found in repository?
examples/basic.rs (lines 72-77)
43fn main() {
44 let mut my_app = MyApp;
45
46 let mut pd_sdl: PgSdl = PgSdl::init("Benday", 1200, 720, Some(60), true, Colors::SKY_BLUE);
47
48 pd_sdl
49 .add_widget(
50 "button",
51 Box::new(Button::new(
52 Colors::ROYAL_BLUE,
53 rect!(500, 500, 200, 100),
54 Some(9),
55 Some(Text::new("Auto !".to_string(), 16, None)),
56 )),
57 )
58 .add_widget(
59 "slider",
60 Box::new(Slider::new(
61 Colors::ROYAL_BLUE,
62 rect!(110, 220, 200, 100),
63 Some(9),
64 SliderType::Continuous {
65 display: None,
66 default_value: 0.5,
67 },
68 )),
69 )
70 .add_widget(
71 "text input",
72 Box::new(TextInput::new(
73 Colors::WHITE,
74 rect!(222, 295, 200, 100),
75 Some(9),
76 Some(Text::new("Auto !".to_string(), 16, None)),
77 )),
78 );
79
80 pd_sdl.run(&mut my_app);
81}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextInput
impl RefUnwindSafe for TextInput
impl Send for TextInput
impl Sync for TextInput
impl Unpin for TextInput
impl UnwindSafe for TextInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more