Skip to main content

gtk/subclass/
stack.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;
7
8use crate::Stack;
9
10pub trait StackImpl: ContainerImpl + ObjectSubclass<Type: IsA<Stack>> {}
11
12unsafe impl<T: StackImpl> IsSubclassable<T> for Stack {
13    fn class_init(class: &mut ::glib::Class<Self>) {
14        Self::parent_class_init::<T>(class);
15
16        if !crate::rt::is_initialized() {
17            panic!("GTK has to be initialized first");
18        }
19    }
20}