Struct tiny_terminal_snake::Frame
source · pub struct Frame { /* private fields */ }
Implementations§
source§impl Frame
impl Frame
pub fn new(row: usize, col: usize) -> Self
pub fn write(&mut self, row: i32, col: i32, s: String) -> Result<()>
pub fn random_point(&mut self, s: &Snake) -> Result<(usize, usize)>
pub fn quit(&mut self)
pub fn show(&mut self, snake: &Snake) -> Result<()>
pub fn make_frame_gui(row: usize, col: usize) -> Flex<Status>
Trait Implementations§
source§impl Widget<Status> for Frame
impl Widget<Status> for Frame
source§fn event(
&mut self,
ctx: &mut EventCtx<'_, '_>,
event: &Event,
data: &mut Status,
_env: &Env
)
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
)
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
)
fn update( &mut self, _ctx: &mut UpdateCtx<'_, '_>, _old_data: &Status, _data: &Status, _env: &Env )
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§
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
fn round_from(x: T) -> T
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
fn round_into(self) -> U
source§impl<T, W> WidgetExt<T> for Wwhere
T: Data,
W: Widget<T> + 'static,
impl<T, W> WidgetExt<T> for Wwhere T: Data, W: Widget<T> + 'static,
source§fn align_left(self) -> Align<T>
fn align_left(self) -> Align<T>
Wrap this widget in an
Align
widget, configured to align left.source§fn align_right(self) -> Align<T>
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>
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>
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>
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>
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>
fn fix_size(self, width: f64, height: f64) -> SizedBox<T>
Wrap this widget in an
SizedBox
with an explicit width and heightsource§fn expand_width(self) -> SizedBox<T>
fn expand_width(self) -> SizedBox<T>
source§fn expand_height(self) -> SizedBox<T>
fn expand_height(self) -> SizedBox<T>
source§fn background(self, brush: impl Into<BackgroundBrush<T>>) -> Container<T>
fn background(self, brush: impl Into<BackgroundBrush<T>>) -> Container<T>
source§fn border(
self,
color: impl Into<KeyOrValue<Color>>,
width: impl Into<KeyOrValue<f64>>
) -> Container<T>
fn border( self, color: impl Into<KeyOrValue<Color>>, width: impl Into<KeyOrValue<f64>> ) -> Container<T>
source§fn controller<C>(self, controller: C) -> ControllerHost<Self, C>where
C: Controller<T, Self>,
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>>
fn on_click( self, f: impl Fn(&mut EventCtx<'_, '_>, &mut T, &Env) + 'static ) -> ControllerHost<Self, Click<T>>
source§fn debug_paint_layout(self) -> EnvScope<T, Self>
fn debug_paint_layout(self) -> EnvScope<T, Self>
Draw the
layout
Rect
s of this widget and its children.source§fn debug_widget_id(self) -> EnvScope<T, Self>
fn debug_widget_id(self) -> EnvScope<T, Self>
Display the
WidgetId
s for this widget and its children, when hot. Read moresource§fn debug_invalidation(self) -> DebugInvalidation<T, Self>
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>
fn debug_widget(self) -> EnvScope<T, Self>
Set the
DEBUG_WIDGET
env variable for this widget (and its descendants). Read moresource§fn parse(self) -> Parse<Self>where
Self: Widget<String>,
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