diff --git a/gtk/src/subclass/scrolled_window.rs b/gtk/src/subclass/scrolled_window.rs index 1e94a362a778..385e542a4cfa 100644 --- a/gtk/src/subclass/scrolled_window.rs +++ b/gtk/src/subclass/scrolled_window.rs @@ -71,6 +71,10 @@ unsafe impl IsSubclassable for ScrolledWindow { fn class_init(class: &mut ::glib::Class) { Self::parent_class_init::(class); + if !crate::rt::is_initialized() { + panic!("GTK has to be initialized first"); + } + let klass = class.as_mut(); klass.move_focus_out = Some(window_move_focus_out::); klass.scroll_child = Some(window_scroll_child::);