gtk: Add fn join_group to RadioToolButton
@@ -5,6 +5,8 @@ use ToolItem;
use ffi;
use glib::object::Downcast;
use glib::translate::*;
+use glib::Value;
+use gobject_ffi;
impl RadioToolButton {
pub fn new() -> RadioToolButton {
@@ -20,4 +22,11 @@ impl RadioToolButton {
ToolItem::from_glib_none(ffi::gtk_radio_tool_button_new_from_stock(ptr::null_mut(), stock_id.to_glib_none().0)).downcast_unchecked()
}
}
+
+ pub fn join_group<'a, P: Into<Option<&'a RadioToolButton>>>(&self, group: P) {
+ let group = group.into();
+ unsafe {
+ gobject_ffi::g_object_set_property(self.to_glib_none().0, "group".to_glib_none().0, Value::from(group).to_glib_none().0);
+ }
+ }
}
