diff options
| author | Joe Carstairs <me@joeac.net> | 2024-12-22 18:28:32 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2024-12-22 18:28:32 +0000 |
| commit | ab3e0439e12dee592a8f6fe2a968e4bb429a60f8 (patch) | |
| tree | aff750c6f2eac8a2d6b703a3a75a45cfa52ec0b3 /schist_gtk4_gui/src/balances_view.rs | |
| parent | 4b3821e8bffb6a8e98525ee0a0bc860e5de7da05 (diff) | |
Adds other views
Diffstat (limited to 'schist_gtk4_gui/src/balances_view.rs')
| -rw-r--r-- | schist_gtk4_gui/src/balances_view.rs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/schist_gtk4_gui/src/balances_view.rs b/schist_gtk4_gui/src/balances_view.rs new file mode 100644 index 0000000..5afb192 --- /dev/null +++ b/schist_gtk4_gui/src/balances_view.rs @@ -0,0 +1,56 @@ +use gtk::{ + glib::{ + self, + subclass::{ + object::{ObjectImpl, ObjectImplExt}, + types::ObjectSubclass, + InitializingObject, + }, + Object, + }, + subclass::{ + box_::BoxImpl, + widget::{CompositeTemplateClass, CompositeTemplateInitializingExt, WidgetImpl}, + }, +}; + +glib::wrapper! { + pub struct SchistBalancesView(ObjectSubclass<SchistBalancesViewImpl>) + @extends gtk::Box, gtk::Widget, + @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable; +} + +impl SchistBalancesView { + pub fn new() -> Self { + Object::builder().build() + } +} + +#[derive(gtk::CompositeTemplate, Default)] +#[template(resource = "/net/joeac/schist/ui/balances_view.ui")] +pub struct SchistBalancesViewImpl {} + +#[glib::object_subclass] +impl ObjectSubclass for SchistBalancesViewImpl { + const NAME: &'static str = "SchistBalancesView"; + type Type = SchistBalancesView; + type ParentType = gtk::Box; + + fn class_init(klass: &mut Self::Class) { + klass.bind_template(); + } + + fn instance_init(obj: &InitializingObject<Self>) { + obj.init_template(); + } +} + +impl ObjectImpl for SchistBalancesViewImpl { + fn constructed(&self) { + self.parent_constructed(); + } +} + +impl WidgetImpl for SchistBalancesViewImpl {} + +impl BoxImpl for SchistBalancesViewImpl {} |
