Add callback function to allow resize messages to be sent on mac.
This commit is contained in:
parent
0164449955
commit
0ad9c3d453
6 changed files with 102 additions and 32 deletions
10
src/lib.rs
10
src/lib.rs
|
|
@ -482,6 +482,13 @@ impl Window {
|
|||
proxy: self.window.create_window_proxy()
|
||||
}
|
||||
}
|
||||
|
||||
/// Sets a resize callback that is called by Mac (and potentially other
|
||||
/// operating systems) during resize operations. This can be used to repaint
|
||||
/// during window resizing.
|
||||
pub fn set_window_resize_callback(&mut self, callback: fn(uint, uint)) {
|
||||
self.window.set_window_resize_callback(callback);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "window")]
|
||||
|
|
@ -542,6 +549,9 @@ impl HeadlessContext {
|
|||
pub fn get_api(&self) -> Api {
|
||||
self.context.get_api()
|
||||
}
|
||||
|
||||
pub fn set_window_resize_callback(&mut self, _: fn(uint, uint)) {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "headless")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue