gtk4/auto/
multi_sorter.rs1use crate::{ffi, Buildable, Sorter};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9 #[doc(alias = "GtkMultiSorter")]
10 pub struct MultiSorter(Object<ffi::GtkMultiSorter, ffi::GtkMultiSorterClass>) @extends Sorter, @implements gio::ListModel, Buildable;
11
12 match fn {
13 type_ => || ffi::gtk_multi_sorter_get_type(),
14 }
15}
16
17impl MultiSorter {
18 #[doc(alias = "gtk_multi_sorter_new")]
19 pub fn new() -> MultiSorter {
20 assert_initialized_main_thread!();
21 unsafe { from_glib_full(ffi::gtk_multi_sorter_new()) }
22 }
23
24 #[doc(alias = "gtk_multi_sorter_append")]
25 pub fn append(&self, sorter: impl IsA<Sorter>) {
26 unsafe {
27 ffi::gtk_multi_sorter_append(self.to_glib_none().0, sorter.upcast().into_glib_ptr());
28 }
29 }
30
31 #[doc(alias = "gtk_multi_sorter_remove")]
32 pub fn remove(&self, position: u32) {
33 unsafe {
34 ffi::gtk_multi_sorter_remove(self.to_glib_none().0, position);
35 }
36 }
37}
38
39impl Default for MultiSorter {
40 fn default() -> Self {
41 Self::new()
42 }
43}