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