diff options
author | Nickolay Ponomarev <asqueella@gmail.com> | 2018-10-28 21:06:18 +0300 |
---|---|---|
committer | Tim Oram <dev@mitmaro.ca> | 2018-11-18 18:12:05 -0330 |
commit | e6217759380bd9f2183764f4a9737b55fa397d9d (patch) | |
tree | 7989016b7275dc86b135216e3c997f99312b17a4 | |
parent | d66b78abcd00e7b9f0df0e47911435085d11511e (diff) |
Add window.draw_prompt() to display arbitrary messages
-rw-r--r-- | src/window.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/window.rs b/src/window.rs index e0ac0e6..1681060 100644 --- a/src/window.rs +++ b/src/window.rs @@ -317,10 +317,14 @@ impl Window { } } - pub fn draw_confirm(&self, message: &str) { + pub fn draw_prompt(&self, message: &str) { self.window.clear(); self.draw_title(); - self.window.addstr(&format!("\n{} (y/n)? ", message)); + self.window.addstr(&format!("\n{} ", message)); + } + + pub fn draw_confirm(&self, message: &str) { + self.draw_prompt(&format!("{}(y/n)? ", message)); } pub fn get_confirm(&self) -> bool { |