Struct LengthBox

Source
pub struct LengthBox { /* private fields */ }

Implementations§

Source§

impl LengthBox

Source

pub fn new(name: &str) -> LengthBox

Source

pub fn with_init(self, init: Units) -> LengthBox

Source

pub fn on_changed<F>(self, callback: F) -> LengthBox
where F: 'static + Fn(&mut LengthBox, &mut State, Entity),

Source

pub fn with_pixels_max(self, max: f32) -> LengthBox

Source

pub fn value(&self) -> Units

Trait Implementations§

Source§

impl Widget for LengthBox

Source§

type Ret = Entity

Source§

type Data = Units

Source§

fn on_build( &mut self, state: &mut State, entity: Entity, ) -> <LengthBox as Widget>::Ret

Source§

fn on_update( &mut self, state: &mut State, entity: Entity, data: &<LengthBox as Widget>::Data, )

Source§

fn on_event(&mut self, state: &mut State, entity: Entity, event: &mut Event)

Source§

fn widget_name(&self) -> String

Source§

fn build<F>( self, state: &mut State, parent: impl AsEntity, builder: F, ) -> Self::Ret
where F: FnMut(Builder<'_, Self>) -> Builder<'_, Self>, Self: Sized + 'static,

Adds the widget into state and returns the associated type Ret - an entity id or a tuple of entity ids
Source§

fn bind<L, F>(self, lens: L, converter: F) -> Wrapper<L, Self>
where L: Lens, F: 'static + Fn(&<L as Lens>::Target) -> Self::Data,

Source§

fn bind2<L>(self, lens: L) -> LensWrap<L, Self>
where L: Lens,

Source§

fn on_style( &mut self, state: &mut State, entity: Entity, property: (String, PropType), )

Source§

fn on_draw( &mut self, state: &mut State, entity: Entity, canvas: &mut Canvas<OpenGl>, )

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> EventHandler for T
where T: Widget + 'static,

Source§

fn widget_name(&self) -> String

Source§

fn on_update( &mut self, state: &mut State, entity: Entity, node: &(dyn Node + 'static), )

Source§

fn on_event_(&mut self, state: &mut State, entity: Entity, event: &mut Event)

Source§

fn on_style( &mut self, state: &mut State, entity: Entity, property: (String, PropType), )

Source§

fn on_draw_( &mut self, state: &mut State, entity: Entity, canvas: &mut Canvas<OpenGl>, )

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Node for T
where T: 'static,