Closed matta closed 1 month ago
Thanks a lot for making this happen, and sorry for the hassle with clippy. It would have been fine to fix this here as well, but the respective PR #247 is on its way to be merged now.
Windows seems to have other issues due to time
and nightly
probably, maybe a regression in the compiler, so it's fair to just ignore that for now.
This is an experiment in converting a program that used the Terminal provided by tui-react into a program that uses the Terminal provided by ratatui. My hypothesis was that the two were not significantly different from eachother, and this seems to be true in this case.
I found that
Widget
trait used by ratatui'sTerminal
is sufficiently powerful to pass arbitrary mutable state to rendering code. A relatively simpleFunctionWidget
trampoline is used to achieve this.The tui_react dependency is retained. The code still calls some tui_react utility functions and uses its List widget instead of the ratatui List widget. These utilities do not depend on the tui_react Terminal and could, in theory, be split out of tui-react into a separate crate.
See also https://github.com/Byron/tui-crates/discussions/9