Struct sixtyfps_corelib::window::Window[][src]

pub struct Window {
    pub meta_properties_tracker: Pin<Rc<PropertyTracker>>,
    // some fields omitted
}

Structure that represent a Window in the runtime

Fields

meta_properties_tracker: Pin<Rc<PropertyTracker>>

Gets dirty when the layout restrictions, or some other property of the windows change FIXME: should only be exposed to the backend

Implementations

impl Window[src]

pub fn new(
    platform_window_fn: impl FnOnce(&Weak<Window>) -> Rc<dyn PlatformWindow>
) -> Rc<Self>
[src]

Create a new instance of the window, given the platform_window factory fn

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

Associates this window with the specified component. Further event handling and rendering, etc. will be done with that component.

pub fn component(&self) -> ComponentRc[src]

return the component. Panics if it wasn’t set.

pub fn try_component(&self) -> Option<ComponentRc>[src]

returns the component or None if it isn’t set.

pub fn process_mouse_input(self: Rc<Self>, pos: Point, what: MouseEventType)[src]

Receive a mouse event and pass it to the items of the component to change their state.

Arguments:

  • pos: The position of the mouse event in window physical coordinates.
  • what: The type of mouse event.
  • component: The SixtyFPS compiled component that provides the tree of items.

pub fn process_key_input(self: Rc<Self>, event: &KeyEvent)[src]

Receive a key event and pass it to the items of the component to change their state.

Arguments:

  • event: The key event received by the windowing system.
  • component: The SixtyFPS compiled component that provides the tree of items.

Installs a binding on the specified property that’s toggled whenever the text cursor is supposed to be visible or not.

pub fn set_focus_item(self: Rc<Self>, focus_item: &ItemRc)[src]

Sets the focus to the item pointed to by item_ptr. This will remove the focus from any currently focused item.

pub fn set_focus(self: Rc<Self>, have_focus: bool)[src]

Sets the focus on the window to true or false, depending on the have_focus argument. This results in WindowFocusReceived and WindowFocusLost events.

pub fn update_window_properties(self: Rc<Self>)[src]

If the component’s root item is a Window element, then this function synchronizes its properties, such as the title for example, with the properties known to the windowing system.

pub fn draw_tracked<R>(self: Rc<Self>, draw_fn: impl FnOnce() -> R) -> R[src]

Calls draw_fn using a crate::properties::PropertyTracker, which is set up to issue a call to PlatformWindow::request_redraw when any properties accessed during drawing change.

Trait Implementations

impl Deref for Window[src]

type Target = dyn PlatformWindow

The resulting type after dereferencing.

impl Drop for Window[src]

Auto Trait Implementations

impl !RefUnwindSafe for Window

impl !Send for Window

impl !Sync for Window

impl Unpin for Window

impl !UnwindSafe for Window

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, 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.