Set up a controller to detect mouse clicks

This commit is contained in:
Savanni D'Gerinel 2023-03-12 09:19:16 -04:00
parent fa8cdf4492
commit f328f4023d
1 changed files with 6 additions and 0 deletions

View File

@ -257,7 +257,13 @@ impl ObjectImpl for HexGridWindowPrivate {
} }
}); });
} }
let click_controller = gtk::GestureClick::new();
click_controller.connect_released(|_, press, x, y| {
println!("key pressed: {} {} {}", press, x, y);
});
self.drawing_area.add_controller(&motion_controller); self.drawing_area.add_controller(&motion_controller);
self.drawing_area.add_controller(&click_controller);
} }
} }