child window creation improvement

This commit is contained in:
k-brac 2016-11-28 13:50:07 +01:00
parent 5a09e8ba21
commit 2b25bf1480
4 changed files with 31 additions and 3 deletions

View file

@ -4,6 +4,8 @@ use libc;
use Window;
use WindowBuilder;
use window;
use winapi;
use platform;
/// Additional methods on `Window` that are specific to Windows.
pub trait WindowExt {
@ -35,3 +37,11 @@ impl WindowBuilderExt for WindowBuilder {
self
}
}
impl WindowBuilderExt {
/// Creates a new WindowProxy from a winapi::HWND
#[inline]
pub fn create_window_proxy_from_handle(handle: winapi::HWND) -> window::WindowProxy {
window::WindowProxy::create_proxy(platform::WindowProxy{hwnd: handle})
}
}