Set up a controller to detect mouse clicks
This commit is contained in:
parent
fa8cdf4492
commit
f328f4023d
|
@ -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(&click_controller);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue