Skip to content

Commit

Permalink
CustomSorter: Implement unset_sort_func
Browse files Browse the repository at this point in the history
Fixes: gtk-rs#22
  • Loading branch information
A6GibKm committed Jan 25, 2021
1 parent be25a35 commit f06c212
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gtk4/src/custom_sorter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use crate::CustomSorter;
use crate::Ordering;
use glib::translate::*;
use std::ptr;

impl CustomSorter {
#[doc(alias = "gtk_custom_sorter_new")]
Expand Down Expand Up @@ -34,6 +35,12 @@ impl CustomSorter {
)
}
}

pub fn unset_sort_func(&self) {
unsafe {
ffi::gtk_custom_sorter_set_sort_func(self.to_glib_none().0, None, ptr::null_mut(), None)
}
}
}

unsafe extern "C" fn destroy_closure<F: Fn(&glib::Object, &glib::Object) -> Ordering + 'static>(
Expand Down

0 comments on commit f06c212

Please sign in to comment.