[−][src]Struct druid::WindowDesc
A description of a window to be instantiated.
This includes a function that can build the root widget, as well as other window properties such as the title.
Fields
id: WindowId
The WindowId
that will be assigned to this window.
This can be used to track a window from when it is launched and when it actually connects.
Implementations
impl<T: Data> WindowDesc<T>
[src]
pub fn new<W, F>(root: F) -> WindowDesc<T> where
W: Widget<T> + 'static,
F: FnOnce() -> W + 'static,
[src]
W: Widget<T> + 'static,
F: FnOnce() -> W + 'static,
Create a new WindowDesc
, taking a function that will generate the root
Widget
for this window.
It is possible that a WindowDesc
can be reused to launch multiple windows.
pub fn title(self, title: impl Into<LabelText<T>>) -> Self
[src]
Set the title for this window. This is a LabelText
; it can be either
a String
, a LocalizedString
, or a closure that computes a string;
it will be kept up to date as the application's state changes.
pub fn menu(self, menu: MenuDesc<T>) -> Self
[src]
Set the menu for this window.
pub fn window_size(self, size: impl Into<Size>) -> Self
[src]
Set the window's initial drawing area size in display points.
You can pass in a tuple (width, height)
or a Size
,
e.g. to create a window with a drawing area 1000dp wide and 500dp high:
window.window_size((1000.0, 500.0));
The actual window size in pixels will depend on the platform DPI settings.
This should be considered a request to the platform to set the size of the window. The platform might increase the size a tiny bit due to DPI.
pub fn with_min_size(self, size: impl Into<Size>) -> Self
[src]
Set the window's minimum drawing area size in display points.
The actual minimum window size in pixels will depend on the platform DPI settings.
This should be considered a request to the platform to set the minimum size of the window. The platform might increase the size a tiny bit due to DPI.
To set the window's initial drawing area size use window_size
.
pub fn resizable(self, resizable: bool) -> Self
[src]
pub fn show_titlebar(self, show_titlebar: bool) -> Self
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for WindowDesc<T>
impl<T> !Send for WindowDesc<T>
impl<T> !Sync for WindowDesc<T>
impl<T> Unpin for WindowDesc<T>
impl<T> !UnwindSafe for WindowDesc<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
fn round_into(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,