From 9d951f5e82cf47cbbb1676d8c81707c2f99c0126 Mon Sep 17 00:00:00 2001 From: Pranav Date: Mon, 16 Dec 2019 11:07:16 -0600 Subject: [PATCH] Update README.md --- README.md | 50 ++++++++++++++------------------------------------ 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 0ca6c0c..717ee33 100644 --- a/README.md +++ b/README.md @@ -27,24 +27,6 @@ To introduce a progress bar in your application, include `indicators/progress_ba ```cpp #include -int main() { - indicators::ProgressBar bar; - return 0; -} -``` - -Here's the general structure of a progress bar: - -``` - ? - ^^^^^^^^^^^^^^^^^^ Bar Width ^^^^^^^^^^^^^^^^^^ ^^^^^ Show/Hide ^^^^^ -``` - -Each of these elements (and more) can be configured using the ProgressBar API. Here's an example configuration: - -```cpp -#include - int main() { indicators::ProgressBar bar; @@ -64,7 +46,14 @@ int main() { } ``` -Now that the bar is configured, let's update the state of the bar. The amount of progress in ProgressBar is maintained as a float in range `[0, 100]`. When progress reaches 100, the progression is complete. +Here's the general structure of a progress bar: + +``` + ? + ^^^^^^^^^^^^^^^^^^ Bar Width ^^^^^^^^^^^^^^^^^^ ^^^^^ Show/Hide ^^^^^ +``` + +The amount of progress in ProgressBar is maintained as a float in range `[0, 100]`. When progress reaches 100, the progression is complete. From application-level code, there are two ways in which you can update this progress: @@ -267,23 +256,6 @@ To introduce a progress spinner in your application, include `indicators/progres ```cpp #include -int main() { - indicators::ProgressSpinner spinner; - return 0; -} -``` - -Here's the general structure of a progress spinner: - -``` - ? -``` - -Each of these elements (and more) can be configured using the ProgressSpinner API. Here's an example configuration: - -```cpp -#include - int main() { indicators::ProgressSpinner spinner; @@ -299,6 +271,12 @@ int main() { } ``` +Here's the general structure of a progress spinner: + +``` + ? +``` + ProgressSpinner has a vector of strings: `spinner_states`. At each update, the spinner will pick the next string from this sequence to print to the console. The spinner state can be updated similarly to ProgressBars: Using either `tick()` or `set_progress(value)`. ```cpp