pub struct PPTerm { /* private fields */ }
Implementations§
source§impl PPTerm
impl PPTerm
pub fn new<L: Into<Option<&'static str>>>( x: i32, y: i32, w: i32, h: i32, label: L ) -> Self
sourcepub fn write_all(&self, s: &[u8]) -> Result<(), Error>
pub fn write_all(&self, s: &[u8]) -> Result<(), Error>
Examples found in repository?
examples/ex1.rs (line 12)
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
fn main() {
let a = app::App::default();
let mut w = window::Window::default().with_size(600, 400);
let term = PPTerm::default().size_of_parent();
w.end();
w.show();
app::add_timeout3(1., move |_| {
term.write_all(r#"echo -e "\033[1;31mHELLO""#.as_bytes())
.unwrap();
term.write_all(b"\n").unwrap();
});
a.run().unwrap();
}
source§impl PPTerm
impl PPTerm
sourcepub fn with_label(self, title: &str) -> Self
pub fn with_label(self, title: &str) -> Self
Initialize with a label
sourcepub fn with_align(self, align: Align) -> Self
pub fn with_align(self, align: Align) -> Self
Initialize with alignment
sourcepub fn with_type<T: WidgetType>(self, typ: T) -> Self
pub fn with_type<T: WidgetType>(self, typ: T) -> Self
Initialize with type
sourcepub fn below_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
pub fn below_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
Initialize at bottom of another widget
sourcepub fn above_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
pub fn above_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
Initialize above of another widget
sourcepub fn right_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
pub fn right_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
Initialize right of another widget
sourcepub fn left_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
pub fn left_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self
Initialize left of another widget
sourcepub fn center_x<W: WidgetExt>(self, w: &W) -> Self
pub fn center_x<W: WidgetExt>(self, w: &W) -> Self
Initialize center of another widget on the x axis
sourcepub fn center_y<W: WidgetExt>(self, w: &W) -> Self
pub fn center_y<W: WidgetExt>(self, w: &W) -> Self
Initialize center of another widget on the y axis
sourcepub fn center_of_parent(self) -> Self
pub fn center_of_parent(self) -> Self
Initialize center of parent
sourcepub fn size_of_parent(self) -> Self
pub fn size_of_parent(self) -> Self
Initialize to the size of the parent
Examples found in repository?
examples/ex1.rs (line 7)
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
fn main() {
let a = app::App::default();
let mut w = window::Window::default().with_size(600, 400);
let term = PPTerm::default().size_of_parent();
w.end();
w.show();
app::add_timeout3(1., move |_| {
term.write_all(r#"echo -e "\033[1;31mHELLO""#.as_bytes())
.unwrap();
term.write_all(b"\n").unwrap();
});
a.run().unwrap();
}
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for PPTerm
impl Send for PPTerm
impl Sync for PPTerm
impl Unpin for PPTerm
impl UnwindSafe for PPTerm
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.