monorepo/kifu/kifu-gtk/src/ui/goban.rs

31 lines
682 B
Rust
Raw Normal View History

2023-03-24 14:14:01 +00:00
use glib::Object;
use gtk::{prelude::*, subclass::prelude::*};
#[derive(Default)]
pub struct GobanPrivate;
#[glib::object_subclass]
impl ObjectSubclass for GobanPrivate {
const NAME: &'static str = "Goban";
type Type = Goban;
type ParentType = gtk::DrawingArea;
}
impl ObjectImpl for GobanPrivate {}
impl WidgetImpl for GobanPrivate {}
impl DrawingAreaImpl for GobanPrivate {}
glib::wrapper! {
pub struct Goban(ObjectSubclass<GobanPrivate>) @extends gtk::DrawingArea, gtk::Widget;
}
impl Goban {
pub fn new() -> Self {
let s: Self = Object::builder().build();
s.set_width_request(1024);
s.set_height_request(768);
s
}
}