gtk4/
tree_row_reference.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4
5use crate::{ffi, prelude::*, TreeIter, TreePath, TreeRowReference};
6
7impl TreeRowReference {
8    /// Lets a set of row reference created by
9    /// gtk_tree_row_reference_new_proxy() know that the
10    /// model emitted the ::rows-reordered signal.
11    ///
12    /// # Deprecated since 4.10
13    ///
14    /// ## `proxy`
15    /// a `GObject`
16    /// ## `path`
17    /// the parent path of the reordered signal
18    /// ## `iter`
19    /// the iter pointing to the parent of the reordered
20    /// ## `new_order`
21    /// the new order of rows
22    #[doc(alias = "gtk_tree_row_reference_reordered")]
23    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
24    #[allow(deprecated)]
25    pub fn reordered(
26        &self,
27        proxy: &impl IsA<glib::Object>,
28        path: &TreePath,
29        iter: &TreeIter,
30        new_order: &[i32],
31    ) {
32        assert_eq!(
33            new_order.len() as i32,
34            self.model().iter_n_children(Some(iter)),
35            "TreeRowReference got passed a `new_order` bigger than the total children in the model for the passed iter"
36        );
37        assert_initialized_main_thread!();
38        unsafe {
39            ffi::gtk_tree_row_reference_reordered(
40                proxy.as_ref().to_glib_none().0,
41                mut_override(path.to_glib_none().0),
42                mut_override(iter.to_glib_none().0),
43                mut_override(new_order.as_ptr()),
44            )
45        }
46    }
47}