child window created using a winapi::HWND instead of a WindowProxy

This commit is contained in:
k-brac 2016-11-29 13:02:42 +01:00
parent 2b25bf1480
commit 3e2154a922
5 changed files with 54 additions and 59 deletions

View file

@ -3,9 +3,7 @@
use libc;
use Window;
use WindowBuilder;
use window;
use winapi;
use platform;
/// Additional methods on `Window` that are specific to Windows.
pub trait WindowExt {
@ -26,22 +24,14 @@ impl WindowExt for Window {
/// Additional methods on `WindowBuilder` that are specific to Windows.
pub trait WindowBuilderExt {
fn with_parent_window(self, parent: window::WindowProxy) -> WindowBuilder;
fn with_parent_window(self, parent: winapi::HWND) -> WindowBuilder;
}
impl WindowBuilderExt for WindowBuilder {
/// Sets a parent to the window to be created
#[inline]
fn with_parent_window(mut self, parent: window::WindowProxy) -> WindowBuilder {
fn with_parent_window(mut self, parent: winapi::HWND) -> WindowBuilder {
self.platform_specific.parent = Some(parent);
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})
}
}