Trait window::AdvancedWindow [] [src]

pub trait AdvancedWindow: Window + Sized {
    fn get_title(&self) -> String;
fn set_title(&mut self, value: String);
fn get_exit_on_esc(&self) -> bool;
fn set_exit_on_esc(&mut self, value: bool);
fn set_capture_cursor(&mut self, value: bool);
fn show(&mut self);
fn hide(&mut self);
fn get_position(&self) -> Option<Position>;
fn set_position<P: Into<Position>>(&mut self, val: P); fn title(self, value: String) -> Self { ... }
fn exit_on_esc(self, value: bool) -> Self { ... }
fn capture_cursor(self, value: bool) -> Self { ... }
fn position<P: Into<Position>>(self, val: P) -> Self { ... } }
[]

Trait representing a window with the most features that are still generic.

This trait is implemented by fully featured window back-ends. When possible, reduce the trait constraint to Window to make the code more portable.

The Sized trait is required for method chaining.

Required Methods

[]

Gets a copy of the title of the window.

[]

Sets the title of the window.

[]

Gets whether to exit when pressing esc.

Useful when prototyping.

[]

Sets whether to exit when pressing esc.

Useful when prototyping.

[]

Sets whether to capture/grab the cursor.

This is used to lock and hide cursor to the window, for example in a first-person shooter game.

[]

Shows the window.

If the platform does not support this, it will have no effect.

[]

Hides the window.

If the platform does not support this, it will have no effect.

[]

Gets the position of window.

[]

Sets the position of window.

Has no effect if the window no longer has a position.

Provided Methods

[]

Sets title on window.

This method moves the current window data, unlike set_title(), so that it can be used in method chaining.

[]

Sets whether to exit when pressing the Esc button.

Useful when prototyping.

This method moves the current window data, unlike set_exit_on_esc(), so that it can be used in method chaining.

[]

Sets whether to capture/grab the cursor.

This method moves the current window data, unlike set_capture_cursor(), so that it can be used in method chaining.

[]

Sets the position of window.

Has no effect if the window no longer has a position.

This method moves the current window data, unlike set_position(), so that it can be used in method chaining.

Implementors