31 lines
682 B
Rust
31 lines
682 B
Rust
|
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
|
||
|
}
|
||
|
}
|