Update Win32 to support submenu API. Not implemented yet.
let mut post_bytes: u32 = 0;
let re = Regex::new(r"Content-Length: ([0-9 ]+)").unwrap();
for line in reader.by_ref().lines() {
- let line_str = line.unwrap();
- if re.is_match(line_str.as_str()) {
- post_bytes = re.captures(line_str.as_str()).unwrap()[1].parse::<u32>().unwrap();
- }
- response.push(line_str.clone());
- if line_str == "" {
- break;
+ if let Ok(line_str) = line {
+ if re.is_match(line_str.as_str()) {
+ post_bytes = re.captures(line_str.as_str()).unwrap()[1].parse::<u32>().unwrap();
+ }
+ response.push(line_str.clone());
+ if line_str == "" {
+ break;
+ }
}
}
match post_bytes {
};
let _ = win.set_tooltip(&tooltip);
}
+ fn add_submenu(&mut self, _label: &str, _callback: NSCallback) -> *mut Object {
+ // TODO: implement submenu support on Windows
+ 0 as *mut Object
+ }
fn add_label(&mut self, label: &str) {
let ref mut win = &mut self.app.window;
let idx = win.add_menu_item(&label.to_string(), false, |_| {});
let ref mut win = &mut self.app.window;
let _ = win.add_menu_separator();
}
- fn add_item(&mut self, item: &str, callback: NSCallback, selected: bool) -> *mut Object {
+ fn add_item(&mut self, _menu: Option<*mut Object>, item: &str, callback: NSCallback, selected: bool) -> *mut Object {
let ref mut win = &mut self.app.window;
let idx = self.idx.get();
self.idx.set(idx+1);