gtk4/
cell_layout.rs
1use glib::translate::*;
4
5use crate::{prelude::*, CellLayout, CellRenderer};
6
7#[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
11#[allow(deprecated)]
12pub trait CellLayoutExtManual: IsA<CellLayout> + 'static {
13 #[doc(alias = "gtk_cell_layout_set_attributes")]
27 fn set_attributes(&self, cell: &impl IsA<CellRenderer>, attributes: &[(&str, i32)]) {
28 self.as_ref().clear_attributes(cell);
29 attributes.iter().for_each(|(attr, column)| {
30 self.as_ref().add_attribute(cell, attr, *column);
31 });
32 }
33
34 #[doc(alias = "gtk_cell_layout_set_cell_data_func")]
35 #[doc(alias = "set_cell_data_func")]
36 fn unset_cell_data_func(&self, cell: &impl IsA<CellRenderer>) {
37 unsafe {
38 crate::ffi::gtk_cell_layout_set_cell_data_func(
39 self.as_ref().to_glib_none().0,
40 cell.as_ref().to_glib_none().0,
41 None,
42 std::ptr::null_mut(),
43 None,
44 );
45 }
46 }
47}
48
49impl<O: IsA<CellLayout>> CellLayoutExtManual for O {}