Minor windows fix

This commit is contained in:
David Lemarier
2021-04-30 12:38:45 -04:00
parent c5aebf2213
commit 9d93a92d8a
2 changed files with 5 additions and 2 deletions

View File

@@ -64,6 +64,9 @@ pub fn initialize(
dbg!(menu);
if let RawWindowHandle::Windows(handle) = window_handle {
let sender: *mut MenuHandler = Box::into_raw(Box::new(menu_handler));
commctrl::SetWindowSubclass(
handle.hwnd as *mut _,
Some(subclass_proc),

View File

@@ -136,7 +136,7 @@ impl Window {
}
pub fn set_menu(&self, new_menu: Option<Vec<Menu>>) {
if let Some(window_menu) = menu {
if let Some(window_menu) = new_menu {
//menu::initialize(window_menu);
}
}
@@ -858,7 +858,7 @@ unsafe fn init<T: 'static>(
let event_loop_runner = event_loop.runner_shared.clone();
let window_handle = win.raw_window_handle();
let menu_handler = MenuHandler::new(
let menu_handler = menu::MenuHandler::new(
win.window.0,
Box::new(move |event| {
if let Ok(e) = event.map_nonuser_event() {