[][src]Struct kas::widget::Window

pub struct Window<W: Widget + 'static> { /* fields omitted */ }

The main instantiation of the Window trait.

Implementations

impl<W: Widget> Window<W>[src]

pub fn new<T: ToString>(title: T, w: W) -> Window<W>[src]

Create

pub fn set_restrict_dimensions(&mut self, min: bool, max: bool)[src]

Configure whether min/max dimensions are forced

By default, the min size is enforced but not the max.

pub fn on_drop<T>(
    &mut self,
    consume: Box<dyn FnMut(&mut W) -> T>
) -> (Future<T>, UpdateHandle)
[src]

Set a closure to be called on destruction, and return a future

The closure consume is called when the window is destroyed, and yields a user-defined value. This value is returned through the returned Future object. In order to be notified when the future completes, its owner should call Manager::update_on_handle with the returned UpdateHandle.

Currently it is not possible for this closure to actually drop the widget, but it may alter its contents: it is the last method call on the widget. (TODO: given unsized rvalues (rfc#1909), the closure should consume self.)

Panics if called more than once. In case the window is cloned, this closure is not inherited by the clone: in that case, on_drop may be called on the clone.

Trait Implementations

impl<W: Widget + Clone> Clone for Window<W>[src]

impl<W: Widget> Debug for Window<W>[src]

impl<W: Widget + 'static> Handler for Window<W> where
    W: Widget<Msg = VoidMsg>, 
[src]

type Msg = VoidMsg

Type of message returned by this widget Read more

impl<W: Widget> Layout for Window<W>[src]

impl<W: Widget<Msg = VoidMsg> + 'static> SendEvent for Window<W>[src]

impl<W: Widget + 'static> Widget for Window<W> where
    W: Widget<Msg = VoidMsg>, 
[src]

impl<W: Widget + 'static> WidgetChildren for Window<W>[src]

impl<W: Widget + 'static> WidgetConfig for Window<W>[src]

impl<W: Widget + 'static> WidgetCore for Window<W>[src]

impl<W: Widget<Msg = VoidMsg> + 'static> Window for Window<W>[src]

Auto Trait Implementations

impl<W> !RefUnwindSafe for Window<W>

impl<W> !Send for Window<W>

impl<W> !Sync for Window<W>

impl<W> Unpin for Window<W> where
    W: Unpin

impl<W> !UnwindSafe for Window<W>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.