From ecbaaca9dab303a75c08bfcb0980a905a1142da6 Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Fri, 20 Sep 2013 18:01:39 -0400 Subject: [PATCH] Take prompt from console from Linux Fixes #964 --- linux.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/linux.rs b/linux.rs index 328d63c..5d30880 100644 --- a/linux.rs +++ b/linux.rs @@ -8,27 +8,29 @@ // except according to those terms. use AlertMethods; +use std::io; /// An alert. -pub struct Alert; +pub struct Alert { + url: ~str, +} impl AlertMethods for Alert { fn new(_: &str) -> Alert { - // TODO - Alert + // TODO: Use a glfw window for prompt + Alert { url: ~"" } } fn add_prompt(&mut self) { - // TODO + print("URL: "); + self.url = io::stdin().read_line(); } fn run(&self) { - // TODO } fn prompt_value(&self) -> ~str { - // TODO - ~"" + self.url.clone() } }