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 Freeze for Frame
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, W> WidgetExt<T> for W
impl<T, W> WidgetExt<T> for W
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 Rects 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
WidgetIds 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>
fn parse(self) -> Parse<Self>
👎Deprecated since 0.7.0: Use TextBox::with_formatter instead
Parse a
Widget<String>’s contents