Closed fmorroni closed 2 months ago
because Widget::render
requires to move out self
I noticed that &TextArea
can implement Widget
. It might be smarter.
impl<'a> Widget for &'a TextArea<'a> {
// ...
}
// Usage
term.draw(|f| {
f.render_widget(&textarea, f.size());
})?;
I noticed that
&TextArea
can implementWidget
. It might be smarter.impl<'a> Widget for &'a TextArea<'a> { // ... } // Usage term.draw(|f| { f.render_widget(&textarea, f.size()); })?;
Yeah that's basically what I did for a vim input widget I'm making. Seems to work fine.
@fmorroni Thanks for clarification. I'll consider this.
This was included in v0.5.3 release.
This was included in v0.5.3 release.
Great thanks!
Hi, why doesn't
TextArea
implement theWidget
trait? I know we have thewidget()
method but that seems kind of unnecessary to me. Is there an advantage to having it that way?