pub struct Frame { /* private fields */ }

Implementations§

source§

impl Frame

source

pub fn new(row: usize, col: usize) -> Self

source

pub fn write(&mut self, row: i32, col: i32, s: String) -> Result<()>

source

pub fn random_point(&mut self, s: &Snake) -> Result<(usize, usize)>

source

pub fn quit(&mut self)

source

pub fn show(&mut self, snake: &Snake) -> Result<()>

source

pub fn make_frame_gui(row: usize, col: usize) -> Flex<Status>

Trait Implementations§

source§

impl Widget<Status> for Frame

source§

fn event( &mut self, ctx: &mut EventCtx<'_, '_>, event: &Event, data: &mut Status, _env: &Env )

need this function for handling the arrow keys.

source§

fn lifecycle( &mut self, _ctx: &mut LifeCycleCtx<'_, '_>, _event: &LifeCycle, _data: &Status, _env: &Env )

Handle a life cycle notification. Read more
source§

fn update( &mut self, _ctx: &mut UpdateCtx<'_, '_>, _old_data: &Status, _data: &Status, _env: &Env )

Update the widget’s appearance in response to a change in the app’s Data or Env. Read more
source§

fn layout( &mut self, _ctx: &mut LayoutCtx<'_, '_>, _bc: &BoxConstraints, _data: &Status, _env: &Env ) -> Size

Compute layout. Read more
source§

fn paint(&mut self, ctx: &mut PaintCtx<'_, '_, '_>, data: &Status, _env: &Env)

Paint the widget appearance. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Frame

§

impl !Send for Frame

§

impl !Sync for Frame

§

impl Unpin for Frame

§

impl UnwindSafe for Frame

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.

§

impl<T> RoundFrom<T> for T

§

fn round_from(x: T) -> T

§

impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,

§

fn round_into(self) -> U

source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T, W> WidgetExt<T> for Wwhere T: Data, W: Widget<T> + 'static,

source§

fn padding(self, insets: impl Into<Insets>) -> Padding<T>

Wrap this widget in a Padding widget with the given Insets.
source§

fn center(self) -> Align<T>

Wrap this widget in an Align widget, configured to center it.
source§

fn align_left(self) -> Align<T>

Wrap this widget in an Align widget, configured to align left.
source§

fn align_right(self) -> Align<T>

Wrap this widget in an Align widget, configured to align right.
source§

fn align_vertical(self, align: UnitPoint) -> Align<T>

Wrap this widget in an Align widget, configured to align vertically.
source§

fn align_horizontal(self, align: UnitPoint) -> Align<T>

Wrap this widget in an Align widget, configured to align horizontally.
source§

fn fix_width(self, width: f64) -> SizedBox<T>

Wrap this widget in a SizedBox with an explicit width.
source§

fn fix_height(self, height: f64) -> SizedBox<T>

Wrap this widget in a SizedBox with an explicit width.
source§

fn fix_size(self, width: f64, height: f64) -> SizedBox<T>

Wrap this widget in an SizedBox with an explicit width and height
source§

fn expand(self) -> SizedBox<T>

Wrap this widget in a SizedBox with an infinite width and height. Read more
source§

fn expand_width(self) -> SizedBox<T>

Wrap this widget in a SizedBox with an infinite width. Read more
source§

fn expand_height(self) -> SizedBox<T>

Wrap this widget in a SizedBox with an infinite width. Read more
source§

fn background(self, brush: impl Into<BackgroundBrush<T>>) -> Container<T>

Wrap this widget in a Container with the provided background. Read more
source§

fn border( self, color: impl Into<KeyOrValue<Color>>, width: impl Into<KeyOrValue<f64>> ) -> Container<T>

Wrap this widget in a Container with the given border. Read more
source§

fn env_scope(self, f: impl Fn(&mut Env, &T) + 'static) -> EnvScope<T, Self>

Wrap this widget in a EnvScope widget, modifying the parent Env with the provided closure.
source§

fn controller<C>(self, controller: C) -> ControllerHost<Self, C>where C: Controller<T, Self>,

Wrap this widget with the provided Controller.
source§

fn on_click( self, f: impl Fn(&mut EventCtx<'_, '_>, &mut T, &Env) + 'static ) -> ControllerHost<Self, Click<T>>

Control the events of this widget with a Click widget. The closure provided will be called when the widget is clicked with the left mouse button. Read more
source§

fn debug_paint_layout(self) -> EnvScope<T, Self>

Draw the layout Rects of this widget and its children.
source§

fn debug_widget_id(self) -> EnvScope<T, Self>

Display the WidgetIds for this widget and its children, when hot. Read more
source§

fn debug_invalidation(self) -> DebugInvalidation<T, Self>

Draw a color-changing rectangle over this widget, allowing you to see the invalidation regions.
source§

fn debug_widget(self) -> EnvScope<T, Self>

Set the DEBUG_WIDGET env variable for this widget (and its descendants). Read more
source§

fn lens<S, L>(self, lens: L) -> LensWrap<S, T, L, Self>where S: Data, L: Lens<S, T>,

Wrap this widget in a LensWrap widget for the provided Lens.
source§

fn parse(self) -> Parse<Self>where Self: Widget<String>,

👎Deprecated since 0.7.0: Use TextBox::with_formatter instead
Parse a Widget<String>’s contents
source§

fn with_id(self, id: WidgetId) -> IdentityWrapper<Self>

Assign the widget a specific WidgetId. Read more
source§

fn boxed(self) -> Box<dyn Widget<T> + 'static, Global>

Wrap this widget in a Box.