use glib::subclass::InitializingObject;
use gtk::subclass::prelude::*;
use gtk::{glib, Button, CompositeTemplate, Entry, Picture};

#[derive(CompositeTemplate, Default)]
#[template(resource = "/org/foxarmy/learn-hieroglyph/cards/new/ui.xml")]
pub struct MemoryCardsNewScene {
    #[template_child]
    pub picture: TemplateChild<Picture>,
    #[template_child]
    pub file_choose_button: TemplateChild<Button>,
    #[template_child]
    pub heiroglyph_entry: TemplateChild<Entry>,
    #[template_child]
    pub reading_entry: TemplateChild<Entry>,
    #[template_child]
    pub translation_entry: TemplateChild<Entry>,
    #[template_child]
    pub done_button: TemplateChild<Button>,
}

#[glib::object_subclass]
impl ObjectSubclass for MemoryCardsNewScene {
    const NAME: &'static str = "MemoryCardsNewScene";
    type Type = super::MemoryCardsNewScene;
    type ParentType = gtk::ApplicationWindow;

    fn class_init(klass: &mut Self::Class) {
        klass.bind_template();
    }

    fn instance_init(obj: &InitializingObject<Self>) {
        obj.init_template();
    }
}

impl ObjectImpl for MemoryCardsNewScene {
    fn constructed(&self) {
        self.parent_constructed();
    }
}


impl WidgetImpl for MemoryCardsNewScene {}

impl WindowImpl for MemoryCardsNewScene {}

impl ApplicationWindowImpl for MemoryCardsNewScene {}
