#[non_exhaustive]pub struct WindowOptions {
pub title: String,
pub size: Size,
pub theme: Theme,
pub instances: usize,
pub backend: Backend,
pub file_drops: bool,
}Expand description
The window run opens.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.title: StringThe window’s title.
size: SizeThe window’s inner size, in logical pixels.
theme: ThemeColors and sizes of the widgets.
instances: usizeRectangles and glyphs a frame can hold; more are dropped (and counted).
backend: BackendThe graphics API that draws the window.
file_drops: boolWhether files dragged onto the window reach App::file_drop (on by default). Off,
the window on Windows does not set up OLE drag and drop, which fails if the thread
already uses COM in its multithreaded mode.
Implementations§
Source§impl WindowOptions
impl WindowOptions
Sourcepub fn new(title: impl Into<String>) -> Self
pub fn new(title: impl Into<String>) -> Self
A 1280x800 window titled title, with the default theme.
Sourcepub fn with_size(self, width: f32, height: f32) -> Self
pub fn with_size(self, width: f32, height: f32) -> Self
The options with an inner size in logical pixels.
Sourcepub fn with_theme(self, theme: Theme) -> Self
pub fn with_theme(self, theme: Theme) -> Self
The options with theme.
Sourcepub fn with_file_drops(self, file_drops: bool) -> Self
pub fn with_file_drops(self, file_drops: bool) -> Self
The options with files dropped on the window reaching the app, or not; see
WindowOptions::file_drops.
Sourcepub fn with_backend(self, backend: Backend) -> Self
pub fn with_backend(self, backend: Backend) -> Self
The options drawing with backend; see Backend.
Sourcepub fn with_instances(self, instances: usize) -> Self
pub fn with_instances(self, instances: usize) -> Self
The options holding up to instances rectangles and glyphs a frame.
Trait Implementations§
Source§impl Clone for WindowOptions
impl Clone for WindowOptions
Auto Trait Implementations§
impl Freeze for WindowOptions
impl RefUnwindSafe for WindowOptions
impl Send for WindowOptions
impl Sync for WindowOptions
impl Unpin for WindowOptions
impl UnsafeUnpin for WindowOptions
impl UnwindSafe for WindowOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.