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

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

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

Implementations

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

pub fn get_widget(&mut self, entity: Entity) -> WidgetContainer<'_>[src]

Returns a specific widget.

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

Creates a new entity.

pub fn update_theme_by_state(&mut self, entity: Entity)[src]

Update theme by state.

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

Appends a child to a parent.

pub fn append_child_to_overlay(&mut self, child: Entity) -> Result<(), String>[src]

Appends a child to overlay (on the top of the main tree). If the overlay does not exists an error will be returned.

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: Box<dyn State + 'static>
)
[src]

Registers a state with a widget.

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

Registers a render object with a widget.

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

Registers an event handler with a widget.

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

Registers a layout object with a widget.

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

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

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

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

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

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

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

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

impl<T> SetParameter for T

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<V, T> VZip<V> for T where
    V: MultiLane<T>,