Struct winit::WindowBuilder [−][src]
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]
impl WindowBuilder
pub fn new() -> WindowBuilder
[src]
pub fn new() -> WindowBuilder
Initializes a new WindowBuilder
with default values.
pub fn with_dimensions(self, size: LogicalSize) -> WindowBuilder
[src]
pub fn with_dimensions(self, size: LogicalSize) -> WindowBuilder
Requests the window to be of specific dimensions.
pub fn with_min_dimensions(self, min_size: LogicalSize) -> WindowBuilder
[src]
pub fn with_min_dimensions(self, min_size: LogicalSize) -> WindowBuilder
Sets a minimum dimension size for the window
pub fn with_max_dimensions(self, max_size: LogicalSize) -> WindowBuilder
[src]
pub fn with_max_dimensions(self, max_size: LogicalSize) -> WindowBuilder
Sets a maximum dimension size for the window
pub fn with_resizable(self, resizable: bool) -> WindowBuilder
[src]
pub fn with_resizable(self, resizable: bool) -> WindowBuilder
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]
pub fn with_title<T: Into<String>>(self, title: T) -> WindowBuilder
Requests a specific title for the window.
pub fn with_fullscreen(self, monitor: Option<MonitorId>) -> WindowBuilder
[src]
pub fn with_fullscreen(self, monitor: Option<MonitorId>) -> WindowBuilder
Sets the window fullscreen state. None means a normal window, Some(MonitorId) means a fullscreen window on that specific monitor
pub fn with_maximized(self, maximized: bool) -> WindowBuilder
[src]
pub fn with_maximized(self, maximized: bool) -> WindowBuilder
Requests maximized mode.
pub fn with_visibility(self, visible: bool) -> WindowBuilder
[src]
pub fn with_visibility(self, visible: bool) -> WindowBuilder
Sets whether the window will be initially hidden or visible.
pub fn with_transparency(self, transparent: bool) -> WindowBuilder
[src]
pub fn with_transparency(self, transparent: bool) -> WindowBuilder
Sets whether the background of the window should be transparent.
pub fn with_decorations(self, decorations: bool) -> WindowBuilder
[src]
pub fn with_decorations(self, decorations: bool) -> WindowBuilder
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]
pub fn with_always_on_top(self, always_on_top: bool) -> WindowBuilder
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]
pub fn with_window_icon(self, window_icon: Option<Icon>) -> WindowBuilder
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 with_multitouch(self) -> WindowBuilder
[src]
pub fn with_multitouch(self) -> WindowBuilder
Enables multitouch.
pub fn build(self, events_loop: &EventsLoop) -> Result<Window, CreationError>
[src]
pub fn build(self, events_loop: &EventsLoop) -> Result<Window, CreationError>
Builds the window.
Error should be very rare and only occur in case of permission denied, incompatible system, out of memory, etc.
Trait Implementations
impl WindowBuilderExt for WindowBuilder
[src]
impl WindowBuilderExt for WindowBuilder
fn with_parent_window(self, parent: HWND) -> WindowBuilder
[src]
fn with_parent_window(self, parent: HWND) -> WindowBuilder
Sets a parent to the window to be created.
fn with_taskbar_icon(self, taskbar_icon: Option<Icon>) -> WindowBuilder
[src]
fn with_taskbar_icon(self, taskbar_icon: Option<Icon>) -> WindowBuilder
This sets ICON_BIG
. A good ceiling here is 256x256.
fn with_no_redirection_bitmap(self, flag: bool) -> WindowBuilder
[src]
fn with_no_redirection_bitmap(self, flag: bool) -> WindowBuilder
This sets WS_EX_NOREDIRECTIONBITMAP
.
impl Clone for WindowBuilder
[src]
impl Clone for WindowBuilder
fn clone(&self) -> WindowBuilder
[src]
fn clone(&self) -> WindowBuilder
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for WindowBuilder
impl Send for WindowBuilder
impl !Sync for WindowBuilder
impl !Sync for WindowBuilder