gtk4/
tree_path.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::{translate::*, Slice};
4
5use crate::TreePath;
6
7impl TreePath {
8    /// Returns the current indices of @self.
9    ///
10    /// This is an array of integers, each representing a node in a tree.
11    /// It also returns the number of elements in the array.
12    /// The array should not be freed.
13    ///
14    /// # Deprecated since 4.10
15    ///
16    ///
17    /// # Returns
18    ///
19    /// The current
20    ///   indices
21    #[doc(alias = "gtk_tree_path_get_indices_with_depth")]
22    #[doc(alias = "get_indices")]
23    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
24    #[allow(deprecated)]
25    pub fn indices(&self) -> Slice<i32> {
26        unsafe {
27            let mut count = 0;
28            let ptr = crate::ffi::gtk_tree_path_get_indices_with_depth(
29                mut_override(self.to_glib_none().0),
30                &mut count,
31            );
32            Slice::from_glib_none_num(ptr, count as usize)
33        }
34    }
35}