gtk/auto/
bin.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 glib::object::IsA;
6use glib::translate::*;
7use gtk_sys;
8use std::fmt;
9use Buildable;
10use Container;
11use Widget;
12
13glib_wrapper! {
14    pub struct Bin(Object<gtk_sys::GtkBin, gtk_sys::GtkBinClass, BinClass>) @extends Container, Widget, @implements Buildable;
15
16    match fn {
17        get_type => || gtk_sys::gtk_bin_get_type(),
18    }
19}
20
21pub const NONE_BIN: Option<&Bin> = None;
22
23pub trait BinExt: 'static {
24    fn get_child(&self) -> Option<Widget>;
25}
26
27impl<O: IsA<Bin>> BinExt for O {
28    fn get_child(&self) -> Option<Widget> {
29        unsafe { from_glib_none(gtk_sys::gtk_bin_get_child(self.as_ref().to_glib_none().0)) }
30    }
31}
32
33impl fmt::Display for Bin {
34    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
35        write!(f, "Bin")
36    }
37}