[−][src]Struct druid::WindowDesc
A function that can create a widget. 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
root_builder: fn() -> Wsize: Option<Size>id: WindowIdThe 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.
phantom_data: PhantomData<T>Methods
impl<T: Data + 'static + Default, W: Widget<T> + 'static> WindowDesc<T, W>[src]
pub fn new(root: fn() -> W) -> WindowDesc<T, W>[src]
Create a new WindowDesc, taking a funciton that will generate the root
Widget for this window.
It is possible that a WindowDesc can be reused to launch multiple windows.
pub fn window_size(self, size: impl Into<Size>) -> Self[src]
Set the window size at creation
You can pass in a tuple (width, height) or kurbo::Size e.g. to create a window 1000px wide and 500px high
window.window_size((1000.0, 500.0));
pub(crate) fn build_native(
&self,
state: &mut AppState<T>
) -> Result<WindowHandle<DruidHandler<T>>, PlatformError>[src]
&self,
state: &mut AppState<T>
) -> Result<WindowHandle<DruidHandler<T>>, PlatformError>
Attempt to create a platform window from this WindowDesc.
Trait Implementations
impl<T: Data + Default, W: Widget<T>> Debug for WindowDesc<T, W>[src]
Implement formatted output for WindowDesc
Auto Trait Implementations
impl<T, W> Send for WindowDesc<T, W> where
T: Send,
T: Send,
impl<T, W> Sync for WindowDesc<T, W> where
T: Sync,
T: Sync,
impl<T, W> Unpin for WindowDesc<T, W> where
T: Unpin,
T: Unpin,
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[src]
fn round_from(x: T) -> T[src]
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>, [src]
U: RoundFrom<T>,
fn round_into(self) -> U[src]
impl<T> Same<T> for T[src]
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>,