Skip to main content

Window

Trait Window 

Source
pub trait Window: Send + Sync {
    // Required methods
    fn close(&self);
    fn set_title(&self, title: &str);
    fn set_size(&self, width: f32, height: f32);
    fn is_key(&self) -> bool;
    fn is_main(&self) -> bool;
    fn is_visible(&self) -> bool;
    fn set_visible(&self, visible: bool);
    fn bring_to_front(&self);
}
Expand description

Abstract trait representing a platform-native window. Implementations delegate calls back to the platform renderers and events.

Required Methods§

Source

fn close(&self)

Request closing of the window.

Source

fn set_title(&self, title: &str)

Change the title bar text of the window.

Source

fn set_size(&self, width: f32, height: f32)

Update the window’s physical dimensions.

Source

fn is_key(&self) -> bool

Check if the window currently has keyboard focus.

Source

fn is_main(&self) -> bool

Check if this is the primary main application window.

Source

fn is_visible(&self) -> bool

Check if the window is currently visible/mapped.

Source

fn set_visible(&self, visible: bool)

Hide or show the window.

Source

fn bring_to_front(&self)

Bring the window to the front and focus it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§