Skip to main content

gtk/
print_settings.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4
5use crate::PrintSettings;
6use crate::{PageRange, ffi};
7
8impl PrintSettings {
9    /// Sets the value of [`PRINT_SETTINGS_PAGE_RANGES`][crate::PRINT_SETTINGS_PAGE_RANGES].
10    /// ## `page_ranges`
11    /// an array of `GtkPageRanges`
12    #[doc(alias = "gtk_print_settings_set_page_ranges")]
13    pub fn set_page_ranges(&self, page_ranges: &[PageRange]) {
14        let num_ranges = page_ranges.len() as i32;
15        unsafe {
16            ffi::gtk_print_settings_set_page_ranges(
17                self.to_glib_none().0,
18                mut_override(page_ranges.as_ptr() as *const _),
19                num_ranges,
20            );
21        }
22    }
23}