1use glib::object::Cast;
2use glib::translate::*;
3use gtk_sys;
4use std::ptr;
5use RadioButton;
6use Widget;
7
8impl RadioButton {
9 pub fn new() -> RadioButton {
10 assert_initialized_main_thread!();
11 unsafe {
12 Widget::from_glib_none(gtk_sys::gtk_radio_button_new(ptr::null_mut())).unsafe_cast()
13 }
14 }
15
16 pub fn new_with_label(label: &str) -> RadioButton {
17 assert_initialized_main_thread!();
18 unsafe {
19 Widget::from_glib_none(gtk_sys::gtk_radio_button_new_with_label(
20 ptr::null_mut(),
21 label.to_glib_none().0,
22 ))
23 .unsafe_cast()
24 }
25 }
26
27 pub fn new_with_mnemonic(label: &str) -> RadioButton {
28 assert_initialized_main_thread!();
29 unsafe {
30 Widget::from_glib_none(gtk_sys::gtk_radio_button_new_with_mnemonic(
31 ptr::null_mut(),
32 label.to_glib_none().0,
33 ))
34 .unsafe_cast()
35 }
36 }
37}