gyscos / gyscos/cursive

Missing BufferView scrollable()

Open
#500 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.8k
Forks
270
Avg merge
5d 19h
Merged PRs (30d)
2

Description

Bug/Help
# Problem description
Hello!
When I add Scrolls via scrollable() method on BufferView from logs example my view behave strangly. With ScrollView I get only single line when previosly I get all the lines of logs. Know every new log rewrite the old line. How can I implement ScrollView for BufferView ?

Code:
```rust
pub fn init_tui(rx : mpsc::Receiver){
let mut siv = cursive::default();

// siv.add_layer(BufferView::new(200, rx).full_screen());

let mut tab_panel = TabPanel::new()
.with_tab("Main", main_tab())
.with_tab("Logs", log_tab(rx));

tab_panel.set_active_tab("Main");

siv.add_layer(tab_panel);

siv.run();
}

fn log_tab(rx :mpsc::Receiver) -> ResizedView {
Dialog::around(BufferView::new(200, rx).scrollable())
.title("Live Logs")
.min_size(cursive::XY::new(100,50))

}
```

Image:
![image](https://user-images.githubusercontent.com/4084564/92595929-4dfa5b00-f2a5-11ea-92a9-82b6e5394d6a.png)

# Environment

* Operating system: Manjaro
* Backend used: crossterm
* Current locale (run `locale` in a terminal):

> LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=pl_PL.UTF-8
LC_TIME=pl_PL.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=pl_PL.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=pl_PL.UTF-8
LC_NAME=pl_PL.UTF-8
LC_ADDRESS=pl_PL.UTF-8
LC_TELEPHONE=pl_PL.UTF-8
LC_MEASUREMENT=pl_PL.UTF-8
LC_IDENTIFICATION=pl_PL.UTF-8
LC_ALL=

* Cursive version (from crates.io, from git, ...):0.15.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.