gtk/subclass/event_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::bin::BinImpl;
7
8use crate::EventBox;
9
10pub trait EventBoxImpl: BinImpl + ObjectSubclass<Type: IsA<EventBox>> {}
11
12unsafe impl<T: EventBoxImpl> IsSubclassable<T> for EventBox {
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}