Render the goban along with ghost images for the cursor #36
|
@ -1,5 +1,6 @@
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use kifu_core::{CoreApp, Request, Response};
|
use kifu_core::{CoreApp, Request, Response};
|
||||||
|
use kifu_gtk::ui::PlayingField;
|
||||||
use std::{
|
use std::{
|
||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
time::Duration,
|
time::Duration,
|
||||||
|
@ -62,8 +63,14 @@ fn main() {
|
||||||
let window = gtk::ApplicationWindow::new(app);
|
let window = gtk::ApplicationWindow::new(app);
|
||||||
window.present();
|
window.present();
|
||||||
|
|
||||||
gtk_rx.attach(None, |message| {
|
gtk_rx.attach(None, move |message| {
|
||||||
println!("message: {:?}", message);
|
println!("message: {:?}", message);
|
||||||
|
match message {
|
||||||
|
Response::PlayingFieldView(view) => {
|
||||||
|
let playing_field = PlayingField::new(view);
|
||||||
|
window.set_child(Some(&playing_field));
|
||||||
|
}
|
||||||
|
}
|
||||||
Continue(true)
|
Continue(true)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,8 @@ impl ObjectImpl for GobanPrivate {
|
||||||
});
|
});
|
||||||
|
|
||||||
context.set_source_rgb(0.1, 0.1, 0.0);
|
context.set_source_rgb(0.1, 0.1, 0.0);
|
||||||
vec![4, 9, 15].into_iter().for_each(|col| {
|
vec![3, 9, 15].into_iter().for_each(|col| {
|
||||||
vec![4, 9, 15].into_iter().for_each(|row| {
|
vec![3, 9, 15].into_iter().for_each(|row| {
|
||||||
pen.star_point(context, col, row);
|
pen.star_point(context, col, row);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue