[][src]Struct sixtyfps_corelib::eventloop::ComponentWindow

#[repr(C)]pub struct ComponentWindow(pub Rc<dyn GenericWindow>);

The ComponentWindow is the (rust) facing public type that can render the items of components to the screen.

Implementations

impl ComponentWindow[src]

pub fn new(window_impl: Rc<dyn GenericWindow>) -> Self[src]

Creates a new instance of a CompomentWindow based on the given window implementation. Only used internally.

pub fn run(&self)[src]

Spins an event loop and renders the items of the provided component in this window.

pub fn scale_factor(&self) -> f32[src]

Returns the scale factor set on the window.

pub fn set_scale_factor(&self, factor: f32)[src]

Sets an overriding scale factor for the window. This is typically only used for testing.

pub fn free_graphics_resources<'a>(&self, items: &Slice<'a, Pin<ItemRef<'a>>>)[src]

This function is called by the generated code when a component and therefore its tree of items are destroyed. The implementation typically uses this to free the underlying graphics resources cached via RenderingCache.

pub fn set_focus_item(&self, focus_item: &ItemRc)[src]

Clears the focus on any previously focused item and makes the provided item the focus item, in order to receive future key events.

pub fn set_component(&self, component: &ComponentRc)[src]

Associates this window with the specified component, for future event handling, etc.

pub fn show_popup(&self, popup: &ComponentRc, position: Point)[src]

Show a popup at the given position

pub fn close_popup(&self)[src]

Close the active popup if any

Trait Implementations

impl Clone for ComponentWindow[src]

Auto Trait Implementations

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<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.