resize implemented
This commit is contained in:
parent
ffed15e697
commit
183f600e1b
@ -17,6 +17,8 @@ pub trait RedrawEvents {
|
|||||||
fn on_put(&mut self, text: &str);
|
fn on_put(&mut self, text: &str);
|
||||||
|
|
||||||
fn on_clear(&mut self);
|
fn on_clear(&mut self);
|
||||||
|
|
||||||
|
fn on_resize(&mut self, columns: u64, rows: u64);
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! try_str {
|
macro_rules! try_str {
|
||||||
@ -103,6 +105,12 @@ fn call(ui: &SharedUi, method: &str, args: Vec<Value>) {
|
|||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
"resize" => {
|
||||||
|
safe_call(ui, move |ui| {
|
||||||
|
ui.borrow_mut().on_resize(try_int!(args[0]), try_int!(args[1]));
|
||||||
|
Ok(())
|
||||||
|
});
|
||||||
|
}
|
||||||
_ => println!("Event {}", method),
|
_ => println!("Event {}", method),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user