Struct fltk_term::PPTerm

source ·
pub struct PPTerm { /* private fields */ }

Implementations§

source§

impl PPTerm

source

pub fn new<L: Into<Option<&'static str>>>( x: i32, y: i32, w: i32, h: i32, label: L ) -> Self

source

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

source

pub fn with_pos(self, x: i32, y: i32) -> Self

Initialize to position x, y

source

pub fn with_size(self, width: i32, height: i32) -> Self

Initialize to size width, height

source

pub fn with_label(self, title: &str) -> Self

Initialize with a label

source

pub fn with_align(self, align: Align) -> Self

Initialize with alignment

source

pub fn with_type<T: WidgetType>(self, typ: T) -> Self

Initialize with type

source

pub fn below_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize at bottom of another widget

source

pub fn above_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize above of another widget

source

pub fn right_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize right of another widget

source

pub fn left_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize left of another widget

source

pub fn center_of<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget

source

pub fn center_x<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget on the x axis

source

pub fn center_y<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget on the y axis

source

pub fn center_of_parent(self) -> Self

Initialize center of parent

source

pub fn size_of<W: WidgetExt>(self, w: &W) -> Self

Initialize to the size of another widget

source

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§

source§

impl Default for PPTerm

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for PPTerm

§

type Target = Group

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for PPTerm

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: 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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.