[][src]Struct orbtk::prelude::api::widget::BuildContext

pub struct BuildContext<'a> { /* fields omitted */ }

Used to create an entity for a widget with its properties as components.

Methods

impl<'a> BuildContext<'a>[src]

pub fn new(
    ecm: &'a mut EntityComponentManager<Tree, StringComponentStore>,
    render_objects: Rc<RefCell<BTreeMap<Entity, Box<dyn RenderObject + 'static>>>>,
    layouts: Rc<RefCell<BTreeMap<Entity, Box<dyn Layout + 'static>>>>,
    handlers: Rc<RefCell<BTreeMap<Entity, Vec<Rc<dyn EventHandler + 'static>>>>>,
    states: Rc<RefCell<BTreeMap<Entity, Rc<dyn State + 'static>>>>
) -> BuildContext<'a>
[src]

Creates a new BuildContext.

pub fn create_entity(&mut self) -> Entity[src]

Creates a new entity.

pub fn append_child(&mut self, parent: Entity, child: Entity)[src]

Appends a child to a parent.

pub fn register_property<P>(&mut self, key: &str, widget: Entity, property: P) where
    P: Component
[src]

Registers a property as component.

pub fn register_property_box(
    &mut self,
    key: &str,
    widget: Entity,
    property: ComponentBox
)
[src]

Registers a property box as component.

pub fn register_shared_property<P>(
    &mut self,
    key: &str,
    target: Entity,
    source: Entity
) where
    P: Component
[src]

Registers a shared property. Uses the key as source key

pub fn register_shared_property_by_source_key<P>(
    &mut self,
    key: &str,
    source_key: &str,
    target: Entity,
    source: Entity
) where
    P: Component
[src]

Registers a shared property.

pub fn register_property_shared_box(
    &mut self,
    key: &str,
    widget: Entity,
    property: SharedComponentBox
)
[src]

Registers a shared component box. Uses the key as source key

pub fn register_property_shared_box_by_source_key(
    &mut self,
    key: &str,
    source_key: &str,
    widget: Entity,
    property: SharedComponentBox
)
[src]

Registers a shared component box.

pub fn register_state(&mut self, widget: Entity, state: Rc<dyn State + 'static>)[src]

Registers a state with a widget.

pub fn register_render_object(
    &self,
    widget: Entity,
    render_object: Box<dyn RenderObject + 'static>
)
[src]

Registers a render object with a widget.

pub fn register_handler(
    &self,
    widget: Entity,
    handler: Rc<dyn EventHandler + 'static>
)
[src]

Registers a event handler with a widget.

pub fn register_layout(&self, widget: Entity, layout: Box<dyn Layout + 'static>)[src]

Registers a layout object with a widget.

Auto Trait Implementations

impl<'a> !Send for BuildContext<'a>

impl<'a> !Sync for BuildContext<'a>

impl<'a> Unpin for BuildContext<'a>

impl<'a> !UnwindSafe for BuildContext<'a>

impl<'a> !RefUnwindSafe for BuildContext<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<E> Component for E where
    E: Any
[src]

impl<T> SetParameter for T