Skip to main content

gtk/subclass/
box_.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::object::IsA;
4use glib::subclass::prelude::*;
5
6use super::container::ContainerImpl;
7use crate::Box;
8
9pub trait BoxImpl: ContainerImpl + ObjectSubclass<Type: IsA<Box>> {}
10
11unsafe impl<T: BoxImpl> IsSubclassable<T> for Box {
12    fn class_init(class: &mut ::glib::Class<Self>) {
13        Self::parent_class_init::<T>(class);
14
15        if !crate::rt::is_initialized() {
16            panic!("GTK has to be initialized first");
17        }
18    }
19}