From dea9818c59a51bbedcd866f55a862b86374e671b Mon Sep 17 00:00:00 2001 From: Florian Dehau Date: Thu, 25 May 2017 15:18:43 +0200 Subject: [PATCH] Update README --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 7383f8ab..4aefebb3 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,10 @@ tui = "0.1.1" ### Create the terminal interface -The first thing to do is to choose from one of the two backends: - -For Termion: +Every application using `tui` should start by instantiating a `Terminal`. It is +a light abstraction over available backends that provides basic functionalities +such as clearing the screen, hiding the cursor, etc. By default only the `termion` +backend is available. ```rust use tui::Terminal; @@ -55,7 +56,17 @@ fn main() { } ``` -For Rustbox: +If for some reason, you might want to use the `rustbox` backend instead, you +need the to replace your `tui` dependency specification by: + +```toml +[dependencies.tui] +version = "0.1.2" +default-features = false +features = ['rustbox'] +``` + +and then create the terminal in a similar way: ```rust use tui::Terminal; @@ -67,17 +78,6 @@ fn main() { } ``` -By default both backends are enabled but you might want to use only one. To do -so, you should disable the default-features for this library and specify the -chosen backend in features. - -```toml -[dependencies.tui] -version = "0.1.1" -default-features = false -features = ['termion'] -``` - ### Layout The library comes with a basic yet useful layout management object called