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 
5 use crate::Buildable;
6 use crate::Container;
7 use crate::Widget;
8 use glib::object::IsA;
9 use glib::translate::*;
10 use std::fmt;
11 
12 glib::wrapper! {
13     #[doc(alias = "GtkBin")]
14     pub struct Bin(Object<ffi::GtkBin, ffi::GtkBinClass>) @extends Container, Widget, @implements Buildable;
15 
16     match fn {
17         type_ => || ffi::gtk_bin_get_type(),
18     }
19 }
20 
21 pub const NONE_BIN: Option<&Bin> = None;
22 
23 pub trait BinExt: 'static {
24     #[doc(alias = "gtk_bin_get_child")]
25     #[doc(alias = "get_child")]
child(&self) -> Option<Widget>26     fn child(&self) -> Option<Widget>;
27 }
28 
29 impl<O: IsA<Bin>> BinExt for O {
child(&self) -> Option<Widget>30     fn child(&self) -> Option<Widget> {
31         unsafe { from_glib_none(ffi::gtk_bin_get_child(self.as_ref().to_glib_none().0)) }
32     }
33 }
34 
35 impl fmt::Display for Bin {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result36     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
37         f.write_str("Bin")
38     }
39 }
40