Place a stone onto the drawing area #38
|
@ -165,7 +165,24 @@ impl ObjectImpl for BoardPrivate {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let gesture = gtk::GestureClick::new();
|
||||||
|
{
|
||||||
|
let board = self.board.clone();
|
||||||
|
let cursor = self.cursor_location.clone();
|
||||||
|
gesture.connect_released(move |_, _, _, _| {
|
||||||
|
let board = board.borrow();
|
||||||
|
let cursor = cursor.borrow();
|
||||||
|
match board.stone(cursor.row, cursor.column) {
|
||||||
|
IntersectionElement::Empty(request) => {
|
||||||
|
println!("need to send request: {:?}", request)
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
self.drawing_area.add_controller(motion_controller);
|
self.drawing_area.add_controller(motion_controller);
|
||||||
|
self.drawing_area.add_controller(gesture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl WidgetImpl for BoardPrivate {}
|
impl WidgetImpl for BoardPrivate {}
|
||||||
|
|
Loading…
Reference in New Issue