Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Add missing GTK initialization check
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Apr 22, 2022
1 parent 50e5e7f commit ba93ca8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gtk/src/subclass/scrolled_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ unsafe impl<T: ScrolledWindowImpl> IsSubclassable<T> for ScrolledWindow {
fn class_init(class: &mut ::glib::Class<Self>) {
Self::parent_class_init::<T>(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::<T>);
klass.scroll_child = Some(window_scroll_child::<T>);
Expand Down

0 comments on commit ba93ca8

Please sign in to comment.