gtk4/
map_list_model.rs
1use glib::translate::*;
4
5use crate::{ffi, prelude::*, MapListModel};
6
7impl MapListModel {
8 #[doc(alias = "gtk_map_list_model_new")]
9 pub fn without_map_func(model: Option<&impl IsA<gio::ListModel>>) -> Self {
10 assert_initialized_main_thread!();
11 unsafe {
12 from_glib_full(ffi::gtk_map_list_model_new(
13 model.map(|p| p.as_ref()).to_glib_full(),
14 None,
15 std::ptr::null_mut(),
16 None,
17 ))
18 }
19 }
20
21 #[doc(alias = "gtk_map_list_model_set_map_func")]
22 #[doc(alias = "set_map_func")]
23 pub fn unset_map_func(&self) {
24 unsafe {
25 ffi::gtk_map_list_model_set_map_func(
26 self.to_glib_none().0,
27 None,
28 std::ptr::null_mut(),
29 None,
30 );
31 }
32 }
33}