forked from deinstapel/cursive-aligned-view
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add blueprints and a builder example
- Loading branch information
Showing
5 changed files
with
73 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use cursive_aligned_view as _; // This needs to be imported to enable the blueprints. | ||
use serde_json::json; | ||
|
||
fn main() { | ||
// This is the same layout as the `simple` example, but using a builder config. | ||
let config = json! ({ | ||
"Panel": { | ||
"title": "Hello, world!", | ||
"view": "DummyView", | ||
"with": [ | ||
{"fixed_width": 20}, | ||
"align_center", | ||
"full_screen", | ||
] | ||
}, | ||
}); | ||
|
||
let context = cursive::builder::Context::new(); | ||
|
||
let mut siv = cursive::default(); | ||
siv.add_layer(context.build(&config).unwrap()); | ||
siv.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters