Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #496 from antoyo/master
Browse files Browse the repository at this point in the history
Add child properties for gtk::Notebook
  • Loading branch information
GuillaumeGomez committed Apr 29, 2017
2 parents 25e3f53 + 400c8db commit 6927e52
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 1 deletion.
28 changes: 28 additions & 0 deletions Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,34 @@ status = "generate"
[[object.function]]
name = "set_current_page"
ignore = true
[[object.child_prop]]
name = "detachable"
type = "gboolean"
doc_hidden=true
[[object.child_prop]]
name = "menu-label"
type = "utf8"
doc_hidden=true
[[object.child_prop]]
name = "position"
type = "gint"
doc_hidden=true
[[object.child_prop]]
name = "reorderable"
type = "gboolean"
doc_hidden=true
[[object.child_prop]]
name = "tab-expand"
type = "gboolean"
doc_hidden=true
[[object.child_prop]]
name = "tab-fill"
type = "gboolean"
doc_hidden=true
[[object.child_prop]]
name = "tab-label"
type = "utf8"
doc_hidden=true

[[object]]
name = "Gtk.Overlay"
Expand Down
100 changes: 99 additions & 1 deletion src/auto/notebook.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (b7f5189) from gir-files (71d73f0)
// This file was generated by gir (bf7bd49) from gir-files (71d73f0)
// DO NOT EDIT

use Container;
Expand Down Expand Up @@ -238,6 +238,104 @@ impl Notebook {
}
}

pub fn get_child_detachable<T: IsA<Widget>>(&self, item: &T) -> bool {
let mut value = Value::from(&false);
unsafe {
ffi::gtk_container_child_get_property(self.to_glib_none().0, item.to_glib_none().0, "detachable".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get().unwrap()
}

pub fn set_child_detachable<T: IsA<Widget>>(&self, item: &T, detachable: bool) {
unsafe {
ffi::gtk_container_child_set_property(self.to_glib_none().0, item.to_glib_none().0, "detachable".to_glib_none().0, Value::from(&detachable).to_glib_none().0);
}
}

pub fn get_child_menu_label<T: IsA<Widget>>(&self, item: &T) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe {
ffi::gtk_container_child_get_property(self.to_glib_none().0, item.to_glib_none().0, "menu-label".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get()
}

pub fn set_child_menu_label<T: IsA<Widget>>(&self, item: &T, menu_label: Option<&str>) {
unsafe {
ffi::gtk_container_child_set_property(self.to_glib_none().0, item.to_glib_none().0, "menu-label".to_glib_none().0, Value::from(menu_label).to_glib_none().0);
}
}

pub fn get_child_position<T: IsA<Widget>>(&self, item: &T) -> i32 {
let mut value = Value::from(&0);
unsafe {
ffi::gtk_container_child_get_property(self.to_glib_none().0, item.to_glib_none().0, "position".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get().unwrap()
}

pub fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32) {
unsafe {
ffi::gtk_container_child_set_property(self.to_glib_none().0, item.to_glib_none().0, "position".to_glib_none().0, Value::from(&position).to_glib_none().0);
}
}

pub fn get_child_reorderable<T: IsA<Widget>>(&self, item: &T) -> bool {
let mut value = Value::from(&false);
unsafe {
ffi::gtk_container_child_get_property(self.to_glib_none().0, item.to_glib_none().0, "reorderable".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get().unwrap()
}

pub fn set_child_reorderable<T: IsA<Widget>>(&self, item: &T, reorderable: bool) {
unsafe {
ffi::gtk_container_child_set_property(self.to_glib_none().0, item.to_glib_none().0, "reorderable".to_glib_none().0, Value::from(&reorderable).to_glib_none().0);
}
}

pub fn get_child_tab_expand<T: IsA<Widget>>(&self, item: &T) -> bool {
let mut value = Value::from(&false);
unsafe {
ffi::gtk_container_child_get_property(self.to_glib_none().0, item.to_glib_none().0, "tab-expand".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get().unwrap()
}

pub fn set_child_tab_expand<T: IsA<Widget>>(&self, item: &T, tab_expand: bool) {
unsafe {
ffi::gtk_container_child_set_property(self.to_glib_none().0, item.to_glib_none().0, "tab-expand".to_glib_none().0, Value::from(&tab_expand).to_glib_none().0);
}
}

pub fn get_child_tab_fill<T: IsA<Widget>>(&self, item: &T) -> bool {
let mut value = Value::from(&false);
unsafe {
ffi::gtk_container_child_get_property(self.to_glib_none().0, item.to_glib_none().0, "tab-fill".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get().unwrap()
}

pub fn set_child_tab_fill<T: IsA<Widget>>(&self, item: &T, tab_fill: bool) {
unsafe {
ffi::gtk_container_child_set_property(self.to_glib_none().0, item.to_glib_none().0, "tab-fill".to_glib_none().0, Value::from(&tab_fill).to_glib_none().0);
}
}

pub fn get_child_tab_label<T: IsA<Widget>>(&self, item: &T) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe {
ffi::gtk_container_child_get_property(self.to_glib_none().0, item.to_glib_none().0, "tab-label".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get()
}

pub fn set_child_tab_label<T: IsA<Widget>>(&self, item: &T, tab_label: Option<&str>) {
unsafe {
ffi::gtk_container_child_set_property(self.to_glib_none().0, item.to_glib_none().0, "tab-label".to_glib_none().0, Value::from(tab_label).to_glib_none().0);
}
}

pub fn connect_change_current_page<F: Fn(&Notebook, i32) -> bool + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Notebook, i32) -> bool + 'static>> = Box_::new(Box_::new(f));
Expand Down

0 comments on commit 6927e52

Please sign in to comment.