gtk/tree_model_filter.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::object::{Cast, IsA};
4use glib::translate::*;
5
6use crate::{TreeModel, TreeModelFilter, TreePath, ffi};
7
8impl TreeModelFilter {
9 #[doc(alias = "gtk_tree_model_filter_new")]
10 pub fn new<T: IsA<TreeModel>>(child_model: &T, root: Option<&TreePath>) -> TreeModelFilter {
11 skip_assert_initialized!();
12 unsafe {
13 TreeModel::from_glib_none(ffi::gtk_tree_model_filter_new(
14 child_model.as_ref().to_glib_none().0,
15 mut_override(root.to_glib_none().0),
16 ))
17 .unsafe_cast()
18 }
19 }
20}