gtk4/auto/
bin_layout.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{ffi, LayoutManager};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    /// [`BinLayout`][crate::BinLayout] is a [`LayoutManager`][crate::LayoutManager] subclass useful for create "bins" of
10    /// widgets.
11    ///
12    /// [`BinLayout`][crate::BinLayout] will stack each child of a widget on top of each other,
13    /// using the [`hexpand`][struct@crate::Widget#hexpand], [`vexpand`][struct@crate::Widget#vexpand],
14    /// [`halign`][struct@crate::Widget#halign], and [`valign`][struct@crate::Widget#valign] properties
15    /// of each child to determine where they should be positioned.
16    ///
17    /// # Implements
18    ///
19    /// [`LayoutManagerExt`][trait@crate::prelude::LayoutManagerExt], [`trait@glib::ObjectExt`]
20    #[doc(alias = "GtkBinLayout")]
21    pub struct BinLayout(Object<ffi::GtkBinLayout, ffi::GtkBinLayoutClass>) @extends LayoutManager;
22
23    match fn {
24        type_ => || ffi::gtk_bin_layout_get_type(),
25    }
26}
27
28impl BinLayout {
29    /// Creates a new [`BinLayout`][crate::BinLayout] instance.
30    ///
31    /// # Returns
32    ///
33    /// the newly created [`BinLayout`][crate::BinLayout]
34    #[doc(alias = "gtk_bin_layout_new")]
35    pub fn new() -> BinLayout {
36        assert_initialized_main_thread!();
37        unsafe { LayoutManager::from_glib_full(ffi::gtk_bin_layout_new()).unsafe_cast() }
38    }
39}
40
41impl Default for BinLayout {
42    fn default() -> Self {
43        Self::new()
44    }
45}