[][src]Struct winit::window::WindowBuilder

pub struct WindowBuilder {
    pub window: WindowAttributes,
    // some fields omitted
}

Object that allows you to build windows.

Fields

window: WindowAttributes

The attributes to use to create the window.

Methods

impl WindowBuilder[src]

pub fn new() -> WindowBuilder[src]

Initializes a new WindowBuilder with default values.

pub fn with_inner_size(self, size: LogicalSize) -> WindowBuilder[src]

Requests the window to be of specific dimensions.

pub fn with_min_inner_size(self, min_size: LogicalSize) -> WindowBuilder[src]

Sets a minimum dimension size for the window

pub fn with_max_inner_size(self, max_size: LogicalSize) -> WindowBuilder[src]

Sets a maximum dimension size for the window

pub fn with_resizable(self, resizable: bool) -> WindowBuilder[src]

Sets whether the window is resizable or not

Note that making the window unresizable doesn't exempt you from handling Resized, as that event can still be triggered by DPI scaling, entering fullscreen mode, etc.

Platform-specific

This only has an effect on desktop platforms.

Due to a bug in XFCE, this has no effect on Xfwm.

pub fn with_title<T: Into<String>>(self, title: T) -> WindowBuilder[src]

Requests a specific title for the window.

pub fn with_fullscreen(self, monitor: Option<Fullscreen>) -> WindowBuilder[src]

Sets the window fullscreen state. None means a normal window, Some(Fullscreen) means a fullscreen window on that specific monitor

Platform-specific

  • Windows: Screen saver is disabled in fullscreen mode.

pub fn with_maximized(self, maximized: bool) -> WindowBuilder[src]

Requests maximized mode.

pub fn with_visible(self, visible: bool) -> WindowBuilder[src]

Sets whether the window will be initially hidden or visible.

pub fn with_transparent(self, transparent: bool) -> WindowBuilder[src]

Sets whether the background of the window should be transparent.

pub fn with_decorations(self, decorations: bool) -> WindowBuilder[src]

Sets whether the window should have a border, a title bar, etc.

pub fn with_always_on_top(self, always_on_top: bool) -> WindowBuilder[src]

Sets whether or not the window will always be on top of other windows.

pub fn with_window_icon(self, window_icon: Option<Icon>) -> WindowBuilder[src]

Sets the window icon. On Windows and X11, this is typically the small icon in the top-left corner of the titlebar.

Platform-specific

This only has an effect on Windows and X11.

On Windows, this sets ICON_SMALL. The base size for a window icon is 16x16, but it's recommended to account for screen scaling and pick a multiple of that, i.e. 32x32.

X11 has no universal guidelines for icon sizes, so you're at the whims of the WM. That said, it's usually in the same ballpark as on Windows.

pub fn build<T: 'static>(
    self,
    window_target: &EventLoopWindowTarget<T>
) -> Result<Window, OsError>
[src]

Builds the window.

Possible causes of error include denied permission, incompatible system, and lack of memory.

Trait Implementations

impl WindowBuilderExtUnix for WindowBuilder[src]

impl Clone for WindowBuilder[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for WindowBuilder[src]

Auto Trait Implementations

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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.

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

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

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