Struct winit::WindowBuilder

source ·
pub struct WindowBuilder {
    pub window: WindowAttributes,
    /* private fields */
}
Expand description

Object that allows you to build windows.

Fields

window: WindowAttributes

The attributes to use to create the window.

Implementations

Initializes a new WindowBuilder with default values.

Requests the window to be of specific dimensions.

Sets a minimum dimension size for the window

Sets a maximum dimension size for the window

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.

Requests a specific title for the window.

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

Requests maximized mode.

Sets whether the window will be initially hidden or visible.

Sets whether the background of the window should be transparent.

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

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

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.

Enables multitouch.

Builds the window.

Error should be very rare and only occur in case of permission denied, incompatible system, out of memory, etc.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Build window with WM_CLASS hint; defaults to the name of the binary. Only relevant on X11.
Build window with override-redirect flag; defaults to false. Only relevant on X11.
Build window with _NET_WM_WINDOW_TYPE hint; defaults to Normal. Only relevant on X11.
Build window with resize increment hint. Only implemented on X11.
Build window with base size hint. Only implemented on X11.
Build window with _GTK_THEME_VARIANT hint set to the specified value. Currently only relevant on X11.
Build window with a given application ID. It should match the .desktop file distributed with your program. Only relevant on Wayland. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Sets value as a parameter of self.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.