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 a91c4f7 commit c89f7e9
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 c89f7e9

Please sign in to comment.