gtk/
tree_model_sort.rs

1// Copyright 2013-2015, The Gtk-rs Project Developers.
2// See the COPYRIGHT file at the top-level directory of this distribution.
3// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
4
5use glib::object::IsA;
6use glib::translate::*;
7use glib::Cast;
8use gtk_sys;
9use TreeModel;
10use TreeModelSort;
11
12impl TreeModelSort {
13    pub fn new<T: IsA<TreeModel>>(child_model: &T) -> TreeModelSort {
14        skip_assert_initialized!();
15        unsafe {
16            TreeModel::from_glib_none(gtk_sys::gtk_tree_model_sort_new_with_model(
17                child_model.as_ref().to_glib_none().0,
18            ))
19            .unsafe_cast()
20        }
21    }
22}