Trait kas::widgets::AdaptWidget
source · pub trait AdaptWidget: Widget + Sized {
// Provided methods
fn map<A, F>(self, f: F) -> Map<A, Self, F>
where F: for<'a> Fn(&'a A) -> &'a Self::Data { ... }
fn on_configure<F>(self, f: F) -> AdaptEvents<Self>
where F: Fn(&mut AdaptConfigCx<'_, '_>, &mut Self) + 'static { ... }
fn on_update<F>(self, f: F) -> AdaptEvents<Self>
where F: Fn(&mut AdaptConfigCx<'_, '_>, &mut Self, &Self::Data) + 'static { ... }
fn on_message<M, H>(self, handler: H) -> AdaptEvents<Self>
where M: Debug + 'static,
H: Fn(&mut AdaptEventCx<'_, '_>, &mut Self, M) + 'static { ... }
fn on_messages<H>(self, handler: H) -> AdaptEvents<Self>
where H: Fn(&mut AdaptEventCx<'_, '_>, &mut Self, &Self::Data) + 'static { ... }
fn with_min_size_px(self, w: i32, h: i32) -> Reserve<Self> { ... }
fn with_min_size_em(self, w: f32, h: f32) -> Reserve<Self> { ... }
fn with_label<D, T>(self, direction: D, label: T) -> WithLabel<Self, D>
where D: Directional,
T: Into<AccessString> { ... }
}
Expand description
Provides some convenience methods on widgets
Provided Methods§
sourcefn map<A, F>(self, f: F) -> Map<A, Self, F>
fn map<A, F>(self, f: F) -> Map<A, Self, F>
Map data type via a function
Returns a wrapper around the input widget.
sourcefn on_configure<F>(self, f: F) -> AdaptEvents<Self>
fn on_configure<F>(self, f: F) -> AdaptEvents<Self>
Call the given closure on Events::configure
Returns a wrapper around the input widget.
sourcefn on_update<F>(self, f: F) -> AdaptEvents<Self>
fn on_update<F>(self, f: F) -> AdaptEvents<Self>
Call the given closure on Events::update
Returns a wrapper around the input widget.
sourcefn on_message<M, H>(self, handler: H) -> AdaptEvents<Self>
fn on_message<M, H>(self, handler: H) -> AdaptEvents<Self>
Add a handler on message of type M
Where access to input data is required, use Self::on_messages
instead.
Returns a wrapper around the input widget.
sourcefn on_messages<H>(self, handler: H) -> AdaptEvents<Self>
fn on_messages<H>(self, handler: H) -> AdaptEvents<Self>
Add a generic message handler
Returns a wrapper around the input widget.
sourcefn with_min_size_px(self, w: i32, h: i32) -> Reserve<Self>
fn with_min_size_px(self, w: i32, h: i32) -> Reserve<Self>
Construct a wrapper, setting minimum size in pixels
The input size is scaled by the scale factor.
Returns a wrapper around the input widget.
sourcefn with_min_size_em(self, w: f32, h: f32) -> Reserve<Self>
fn with_min_size_em(self, w: f32, h: f32) -> Reserve<Self>
Construct a wrapper, setting minimum size in Em
This depends on the font size, though not the exact font in use.
Returns a wrapper around the input widget.
sourcefn with_label<D, T>(self, direction: D, label: T) -> WithLabel<Self, D>
fn with_label<D, T>(self, direction: D, label: T) -> WithLabel<Self, D>
Construct a wrapper widget adding a label
Returns a wrapper around the input widget.