gtk/subclass/drawing_area.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::widget::WidgetImpl;
7use crate::DrawingArea;
8
9pub trait DrawingAreaImpl: WidgetImpl + ObjectSubclass<Type: IsA<DrawingArea>> {}
10
11unsafe impl<T: DrawingAreaImpl> IsSubclassable<T> for DrawingArea {
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}