use gtk::{self, IsA, Object};
use super::{DisplayVariant, Relm, RemoteRelm};
pub trait Widget
where Self: Clone + Sized,
Self::Container: Clone + IsA<gtk::Widget>,
Self::Msg: Clone + DisplayVariant,
{
type Container;
type Model;
type Msg;
fn container(&self) -> &Self::Container;
fn init_view(&self) {
}
fn model() -> Self::Model;
fn on_add<W: IsA<gtk::Widget> + IsA<Object>>(&self, _parent: W) {
}
fn subscriptions(_relm: &Relm<Self::Msg>) {
}
fn update(&mut self, event: Self::Msg, model: &mut Self::Model);
fn update_command(_relm: &Relm<Self::Msg>, _event: Self::Msg, _model: &mut Self::Model) {
}
fn view(relm: RemoteRelm<Self::Msg>, model: &Self::Model) -> Self;
}