Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn visit_url(s: &mut Cursive, url: &str) {
- s.pop_layer();
- match get_data(&url) {
- Ok(new_content) => {
- let mut select = SelectView::new()
- .h_align(HAlign::Left)
- .autojump();
- s.add_layer(Dialog::info(url));
- select.add_all_str(new_content.lines());
- select.set_on_submit(|s,line| {
- follow_link(s, line, url)
- });
- s.add_layer(
- Dialog::around(select.scrollable().full_screen()).title(url),
- );
- },
- Err(msg) => {
- s.add_layer(Dialog::info(msg));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement