Skip to content

Instantly share code, notes, and snippets.

@tilpner
Created September 6, 2016 17:34
Show Gist options
  • Save tilpner/ab4e972de3ea1a04f8c68ba1e9e26ad1 to your computer and use it in GitHub Desktop.
Save tilpner/ab4e972de3ea1a04f8c68ba1e9e26ad1 to your computer and use it in GitHub Desktop.
extern crate cursive;
use std::env;
use cursive::prelude::*;
fn main() {
// Creates the cursive root - required for every application.
let mut siv = Cursive::new();
let msg = format!("Hi. Do the borders look broken to you too?
It's probably something about the locales...\nYour TERM is {term}, LANG is {lang}.",
term = env::var("TERM").unwrap_or("missing".into()),
lang = env::var("LANG").unwrap_or("missing".into()));
// Creates a dialog with a single "Quit" button
siv.add_layer(Dialog::new(TextView::new(msg))
.title("Hi.")
.button("Quit", |s| s.quit()));
// Starts the event loop.
siv.run();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment