1extern crate cursive;
2extern crate cursive_hexview;
3
4use cursive::views::{Dialog, DummyView, LinearLayout, TextView};
5use cursive_hexview::{DisplayState, HexView};
6
7fn main() {
8 let mut cur = cursive::default();
9 let explanation = TextView::new("Use the keys + - ↑ ↓ ← → 0-9 a-f for the HexView.\nUse q to exit.");
10 let view = HexView::new().display_state(DisplayState::Editable);
11
12 cur.add_layer(
13 Dialog::around(LinearLayout::vertical().child(explanation).child(DummyView).child(view)).title("HexView"),
14 );
15 cur.add_global_callback('q', |cur| cur.quit());
16 cur.run();
17}