Trait winit::platform::web::WindowAttributesExtWebSys
source · pub trait WindowAttributesExtWebSys {
// Required methods
fn with_canvas(self, canvas: Option<HtmlCanvasElement>) -> Self;
fn with_prevent_default(self, prevent_default: bool) -> Self;
fn with_focusable(self, focusable: bool) -> Self;
fn with_append(self, append: bool) -> Self;
}
Available on
web_platform
only.Required Methods§
sourcefn with_canvas(self, canvas: Option<HtmlCanvasElement>) -> Self
fn with_canvas(self, canvas: Option<HtmlCanvasElement>) -> Self
Pass an HtmlCanvasElement
to be used for this Window
. If None
,
WindowAttributes::default()
will create one.
In any case, the canvas won’t be automatically inserted into the web page.
None
by default.
sourcefn with_prevent_default(self, prevent_default: bool) -> Self
fn with_prevent_default(self, prevent_default: bool) -> Self
Sets whether event.preventDefault()
should be called on events on the
canvas that have side effects.
See Window::set_prevent_default()
for more details.
Enabled by default.
sourcefn with_focusable(self, focusable: bool) -> Self
fn with_focusable(self, focusable: bool) -> Self
Whether the canvas should be focusable using the tab key. This is necessary to capture canvas keyboard events.
Enabled by default.
sourcefn with_append(self, append: bool) -> Self
fn with_append(self, append: bool) -> Self
On window creation, append the canvas element to the web page if it isn’t already.
Disabled by default.
Object Safety§
This trait is not object safe.