FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    El

    struct · ferroui-view · v0.5.0

    struct El<T>
    

    The element of a control class T, built with chained setters. Turns into an Element.

    View source

    Members

    new

    fn new() -> Self
    

    An element of T with nothing set.

    Source

    key

    fn key(self: Self, key: impl Into<crate::Key>) -> Self
    

    The key of the element among its siblings.

    Source

    name

    fn name(self: Self, name: impl Into<String>) -> Self
    

    The Name of the control.

    Source

    class

    fn class(self: Self, classes: &str) -> Self
    

    Adds style classes, separated by spaces ("accent large").

    Source

    classes

    fn classes(self: Self, classes: &str) -> Self
    

    Adds style classes, separated by spaces; the same as class.

    Source

    set

    fn set<P: TypedProperty + ?Sized, M>(self: Self, property: &'static P, value: impl IntoProp<<P as >::Value, M>) -> Self
    

    Gives a property a value; the same as the generated setter of the property, for any property (an attached one of another crate, one the generator left out).

    Source

    bind

    fn bind<P: TypedProperty + ?Sized>(self: Self, property: &'static P, binding: impl BindingBase + 'static) -> Self
    

    Binds a property with a binding of the property system (the indexer control[!Property] = binding upstream).

    Source

    on

    fn on<A: IRoutedEventArgs + 'static>(self: Self, event: &'static RoutedEvent<A>, handler: impl Fn(&Interactive, &A) -> () + 'static) -> Self
    

    Handles a routed event with the control that handles it.

    Source

    on_changed

    fn on_changed<P: TypedProperty + ?Sized>(self: Self, property: &'static P, handler: impl Fn(&<P as >::Value) -> () + 'static) -> Self
    

    Calls handler with the new value whenever property changes on the control (the user typed, a slider moved, a binding set it).

    Source

    with

    fn with(self: Self, f: impl Fn(&Ref<T>) -> () + 'static) -> Self
    where T: ObjectType
    

    Calls f with the control once it was made and given its values and children: what a builder cannot say (a control kept in a NodeRef, a call the class has no property for).

    Source

    styles

    fn styles(self: Self, styles: impl IntoIterator<Item = crate::style::StyleBuilder>) -> Self
    

    Adds styles to the control (Styles of the control): they apply to it and to the controls below it. They are added when the control is made.

    Source

    node_ref

    fn node_ref(self: Self, node_ref: crate::NodeRef<T>) -> Self
    where T: ObjectType
    

    Keeps the control in node_ref once it is made.

    Source

    child

    fn child(self: Self, child: impl IntoChild) -> Self
    

    Adds a child: an element, a builder, text or a list. Children go into the content of the control: Children of a panel, Items of an items control, Content of a content control, Child of a decorator, the text of a TextBlock.

    Source

    children

    fn children(self: Self, children: impl IntoChildren) -> Self
    

    Adds children: a vector, an array or a tuple of them.

    Source

    build

    fn build(self: Self) -> Element
    

    The element.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.