complete cards/game

This commit is contained in:
2024-04-07 14:08:57 +03:00
parent 24acb4ecd1
commit 857613a01d
10 changed files with 257 additions and 29 deletions

View File

@@ -1,9 +1,7 @@
use std::cell::RefCell;
use std::sync::OnceLock;
use glib::subclass::InitializingObject;
use glib::Properties;
use gtk::glib::subclass::Signal;
use gtk::subclass::prelude::*;
use gtk::{glib, prelude::*, Button, CompositeTemplate, Label, Picture};
@@ -44,19 +42,9 @@ impl ObjectSubclass for CardEntry {
}
#[glib::derived_properties]
impl ObjectImpl for CardEntry {
fn signals() -> &'static [Signal] {
static SIGNALS: OnceLock<Vec<Signal>> = OnceLock::new();
SIGNALS.get_or_init(|| {
vec![Signal::builder("created")
.build()]
})
}
fn constructed(&self) {
self.parent_constructed();
let hieroglyph_label_binding: &Label = self.hieroglyph_label.as_ref();
self.obj()
.bind_property("hieroglyph", hieroglyph_label_binding, "label")