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 /// A layout manager for widgets with a single child.
10 ///
11 /// [`BinLayout`][crate::BinLayout] will stack each child of a widget on top of each other,
12 /// using the [`hexpand`][struct@crate::Widget#hexpand], [`vexpand`][struct@crate::Widget#vexpand],
13 /// [`halign`][struct@crate::Widget#halign], and [`valign`][struct@crate::Widget#valign] properties
14 /// of each child to determine where they should be positioned.
15 ///
16 /// # Implements
17 ///
18 /// [`LayoutManagerExt`][trait@crate::prelude::LayoutManagerExt], [`trait@glib::ObjectExt`]
19 #[doc(alias = "GtkBinLayout")]
20 pub struct BinLayout(Object<ffi::GtkBinLayout, ffi::GtkBinLayoutClass>) @extends LayoutManager;
21
22 match fn {
23 type_ => || ffi::gtk_bin_layout_get_type(),
24 }
25}
26
27impl BinLayout {
28 /// Creates a new [`BinLayout`][crate::BinLayout] instance.
29 ///
30 /// # Returns
31 ///
32 /// the newly created [`BinLayout`][crate::BinLayout]
33 #[doc(alias = "gtk_bin_layout_new")]
34 pub fn new() -> BinLayout {
35 assert_initialized_main_thread!();
36 unsafe { LayoutManager::from_glib_full(ffi::gtk_bin_layout_new()).unsafe_cast() }
37 }
38}
39
40impl Default for BinLayout {
41 fn default() -> Self {
42 Self::new()
43 }
44}