[gtkmm] RadioToolButton: Fix set_group(). Add reset_group().



commit f05d307e323e16e4a700a1e5a4c5f41147abe339
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Thu Jul 25 09:20:15 2013 +0200

    RadioToolButton: Fix set_group(). Add reset_group().
    
    * gtk/src/radiotoolbutton.[hg|ccg]: set_group() must update the group after
    setting it, like in RadioButton and RadioMenuItem. Add reset_group().

 gtk/src/radiotoolbutton.ccg |   12 ++++++++++++
 gtk/src/radiotoolbutton.hg  |   16 +++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/gtk/src/radiotoolbutton.ccg b/gtk/src/radiotoolbutton.ccg
index 51524fd..1ba4538 100644
--- a/gtk/src/radiotoolbutton.ccg
+++ b/gtk/src/radiotoolbutton.ccg
@@ -61,6 +61,18 @@ RadioToolButton::RadioToolButton(Widget& icon_widget, const Glib::ustring& label
 {
 }
 
+void RadioToolButton::set_group(Group& group)
+{
+  gtk_radio_tool_button_set_group(gobj(), group.group_);
+
+  //The group will be updated, ready for use with the next radio tool button:
+  group = get_group();
+}
+
+void RadioToolButton::reset_group()
+{
+  gtk_radio_tool_button_set_group(gobj(), 0);
+}
 
 } // namespace Gtk
 
diff --git a/gtk/src/radiotoolbutton.hg b/gtk/src/radiotoolbutton.hg
index cdd9b8f..39b5454 100644
--- a/gtk/src/radiotoolbutton.hg
+++ b/gtk/src/radiotoolbutton.hg
@@ -100,7 +100,21 @@ public:
 
 
   _WRAP_METHOD(Group get_group(), gtk_radio_tool_button_get_group)
-  _WRAP_METHOD(void set_group(Group& group), gtk_radio_tool_button_set_group)
+
+  /** Adds the radio tool button to @a group, removing it from the group it belonged to before.
+   * You can obtain a suitable group from another radio tool button by using get_group().
+   * 
+   * @newin{2,4}
+   * @param group An existing radio button group.
+   */
+  void set_group(Group& group);
+
+  /** Removes the radio tool button from the group.
+   *
+   * @newin{3,10}
+   */
+  void reset_group();
+  _IGNORE(gtk_radio_tool_button_set_group)
 
   //Probably wouldn't work: _WRAP_PROPERTY("group", Group)
 };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]