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

Commit

Permalink
Add fn join_group to RadioToolButton
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaiter committed Oct 25, 2017
1 parent 28a21e4 commit 3a18a7c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/radio_tool_button.rs
Expand Up @@ -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 {
Expand All @@ -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);
}
}
}

0 comments on commit 3a18a7c

Please sign in to comment.