[gtkmm] Gdk, Gtk: Update for the latest gtk4 (remove Gtk::RadioButton, etc.)



commit 742dae0087022014ba5f29d881f46558d1d1eb2d
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Thu Sep 3 08:56:00 2020 +0200

    Gdk, Gtk: Update for the latest gtk4 (remove Gtk::RadioButton, etc.)

 .gitignore                            |   2 -
 demos/gtk-demo/example_iconbrowser.cc |   8 +--
 gdk/src/surface.hg                    |   2 +-
 gtk/gtkmm.h                           |   1 -
 gtk/gtkmm/filelist.am                 |   2 -
 gtk/gtkmm/meson.build                 |   2 -
 gtk/gtkmm/radiobuttongroup.cc         |  53 -----------------
 gtk/gtkmm/radiobuttongroup.h          |  66 ----------------------
 gtk/src/accessible.ccg                |  23 ++++++++
 gtk/src/accessible.hg                 |  40 ++++++++++---
 gtk/src/checkbutton.ccg               |   6 +-
 gtk/src/checkbutton.hg                |  45 +++++++++------
 gtk/src/columnview.hg                 |  11 ++--
 gtk/src/filelist.am                   |   1 -
 gtk/src/listview.hg                   |  16 +++---
 gtk/src/radiobutton.ccg               |  65 ---------------------
 gtk/src/radiobutton.hg                | 103 ----------------------------------
 gtk/src/togglebutton.ccg              |   5 ++
 gtk/src/togglebutton.hg               |  28 ++++++---
 tools/m4/convert_gtk.m4               |   7 +--
 20 files changed, 134 insertions(+), 352 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e739b7ef..a1e3aa94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -459,8 +459,6 @@ gtk/gtkmm/printunixdialog.cc
 gtk/gtkmm/printunixdialog.h
 gtk/gtkmm/progressbar.cc
 gtk/gtkmm/progressbar.h
-gtk/gtkmm/radiobutton.cc
-gtk/gtkmm/radiobutton.h
 gtk/gtkmm/range.cc
 gtk/gtkmm/range.h
 gtk/gtkmm/root.cc
diff --git a/demos/gtk-demo/example_iconbrowser.cc b/demos/gtk-demo/example_iconbrowser.cc
index 4ae3de27..4770778b 100644
--- a/demos/gtk-demo/example_iconbrowser.cc
+++ b/demos/gtk-demo/example_iconbrowser.cc
@@ -139,8 +139,8 @@ protected:
   // Child widgets, header bar:
   Gtk::HeaderBar m_header;
   Gtk::Box m_header_radio_button_box;
-  Gtk::RadioButton m_normal_radio;
-  Gtk::RadioButton m_symbolic_radio;
+  Gtk::ToggleButton m_normal_radio;
+  Gtk::ToggleButton m_symbolic_radio;
   Gtk::ToggleButton m_search_button;
 
   Glib::RefPtr<Gtk::SizeGroup> m_button_size_group;
@@ -202,9 +202,7 @@ Example_IconBrowser::Example_IconBrowser()
   m_header_radio_button_box.append(m_normal_radio);
   m_symbolic_radio.set_expand();
   m_header_radio_button_box.append(m_symbolic_radio);
-  m_normal_radio.set_draw_indicator(false); // Make it look as a normal button
-  m_symbolic_radio.set_draw_indicator(false);
-  m_symbolic_radio.join_group(m_normal_radio);
+  m_symbolic_radio.set_group(m_normal_radio);
 
   m_button_size_group = Gtk::SizeGroup::create(Gtk::SizeGroup::Mode::VERTICAL);
   m_button_size_group->add_widget(m_normal_radio);
diff --git a/gdk/src/surface.hg b/gdk/src/surface.hg
index 2dc53783..abb9a3c9 100644
--- a/gdk/src/surface.hg
+++ b/gdk/src/surface.hg
@@ -132,7 +132,7 @@ public:
 
   _WRAP_METHOD(int get_scale_factor() const, gdk_surface_get_scale_factor)
 
-  _WRAP_METHOD(void get_device_position(const Glib::RefPtr<const Device>& device, double& x, double& y, 
ModifierType& mask) const, gdk_surface_get_device_position)
+  _WRAP_METHOD(bool get_device_position(const Glib::RefPtr<const Device>& device, double& x, double& y, 
ModifierType& mask) const, gdk_surface_get_device_position)
 
   #m4 _CONVERSION(`::Cairo::Content',`cairo_content_t',`(cairo_content_t)($3)')
   _WRAP_METHOD(::Cairo::RefPtr< ::Cairo::Surface> create_similar_surface(::Cairo::Content content, int 
width,  int height), gdk_surface_create_similar_surface )
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index bddffbea..8984a0d8 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -230,7 +230,6 @@ extern const int gtkmm_micro_version;
 # include <gtkmm/printunixdialog.h>
 #endif
 #include <gtkmm/progressbar.h>
-#include <gtkmm/radiobutton.h>
 #include <gtkmm/range.h>
 #include <gtkmm/recentinfo.h>
 #include <gtkmm/recentmanager.h>
diff --git a/gtk/gtkmm/filelist.am b/gtk/gtkmm/filelist.am
index 82711ed9..74a92fe7 100644
--- a/gtk/gtkmm/filelist.am
+++ b/gtk/gtkmm/filelist.am
@@ -11,7 +11,6 @@ gtkmm_files_extra_any_cc =            \
        init.cc \
        listviewtext.cc                 \
        object.cc \
-       radiobuttongroup.cc             \
        treemodelcolumn.cc              \
        treeview_private.cc
 
@@ -25,7 +24,6 @@ gtkmm_files_extra_any_h =                     \
        init.h \
        listviewtext.h                  \
        object.h \
-       radiobuttongroup.h              \
        treemodelcolumn.h               \
        treeview_private.h              \
        version.h \
diff --git a/gtk/gtkmm/meson.build b/gtk/gtkmm/meson.build
index b8c57170..c62e9e67 100644
--- a/gtk/gtkmm/meson.build
+++ b/gtk/gtkmm/meson.build
@@ -181,7 +181,6 @@ gtkmm_any_hg_ccg_basenames = [
   'printoperationpreview',
   'printsettings',
   'progressbar',
-  'radiobutton',
   'range',
   'recentinfo',
   'recentmanager',
@@ -282,7 +281,6 @@ gtkmm_extra_any_h_cc_basenames = [
   'init',
   'listviewtext',
   'object',
-  'radiobuttongroup',
   'treemodelcolumn',
   'treeview_private',
 ]
diff --git a/gtk/src/accessible.ccg b/gtk/src/accessible.ccg
index 5aa6fc64..a5f98f49 100644
--- a/gtk/src/accessible.ccg
+++ b/gtk/src/accessible.ccg
@@ -17,3 +17,26 @@
 #include <gtk/gtk.h>
 
 using Role = Gtk::Accessible::Role;
+
+namespace Gtk
+{
+
+void Accessible::update_state(State state, const Glib::ValueBase& value)
+{
+  auto c_state = static_cast<GtkAccessibleState>(state);
+  gtk_accessible_update_state_value(gobj(), 1, &c_state, value.gobj());
+}
+
+void Accessible::update_property(Property property, const Glib::ValueBase& value)
+{
+  auto c_prop = static_cast<GtkAccessibleProperty>(property);
+  gtk_accessible_update_property_value(gobj(), 1, &c_prop, value.gobj());
+}
+
+void Accessible::update_relation(Relation relation, const Glib::ValueBase& value)
+{
+  auto c_rel = static_cast<GtkAccessibleRelation>(relation);
+  gtk_accessible_update_relation_value(gobj(), 1, &c_rel, value.gobj());
+}
+
+} // namespace Gtk
diff --git a/gtk/src/accessible.hg b/gtk/src/accessible.hg
index a16f360f..a348d995 100644
--- a/gtk/src/accessible.hg
+++ b/gtk/src/accessible.hg
@@ -63,13 +63,39 @@ public:
 
   _WRAP_METHOD(Role get_accessible_role() const, gtk_accessible_get_accessible_role)
 
-  _IGNORE(gtk_accessible_update_state, gtk_accessible_update_property, gtk_accessible_update_relation)
-  _WRAP_METHOD(void update_state(State state, const Glib::ValueBase& value),
-    gtk_accessible_update_state_value)
-  _WRAP_METHOD(void update_property(Property property, const Glib::ValueBase& value),
-    gtk_accessible_update_property_value)
-  _WRAP_METHOD(void update_relation(Relation relation, const Glib::ValueBase& value),
-    gtk_accessible_update_relation_value)
+  _IGNORE(gtk_accessible_update_state, gtk_accessible_update_property,
+    gtk_accessible_update_relation, gtk_accessible_update_state_value,
+    gtk_accessible_update_property_value, gtk_accessible_update_relation_value)
+
+  /** Updates an accessible state.
+   *
+   * This function should be called by Gtk::Widget types whenever an accessible
+   * state change must be communicated to assistive technologies.
+   *
+   * @param state A Gtk::Accessible::State.
+   * @param value A Glib::ValueBase.
+   */
+  void update_state(State state, const Glib::ValueBase& value);
+
+  /** Updates an accessible property.
+   *
+   * This function should be called by Gtk::Widget types whenever an accessible
+   * property change must be communicated to assistive technologies.
+   *
+   * @param property A Gtk::Accessible::Property.
+   * @param value A Glib::ValueBase.
+   */
+  void update_property(Property property, const Glib::ValueBase& value);
+
+  /** Updates an accessible relation.
+   *
+   * This function should be called by Gtk::Widget types whenever an accessible
+   * relation change must be communicated to assistive technologies.
+   *
+   * @param relation A Gtk::Accessible::Relation.
+   * @param value A Glib::ValueBase.
+   */
+  void update_relation(Relation relation, const Glib::ValueBase& value);
 
   _WRAP_METHOD(void reset_state(State state), gtk_accessible_reset_state)
   _WRAP_METHOD(void reset_property(Property property), gtk_accessible_reset_property)
diff --git a/gtk/src/checkbutton.ccg b/gtk/src/checkbutton.ccg
index 341ebd47..b9cf3c23 100644
--- a/gtk/src/checkbutton.ccg
+++ b/gtk/src/checkbutton.ccg
@@ -26,5 +26,9 @@ CheckButton::CheckButton(const Glib::ustring& label, bool mnemonic)
   _CONSTRUCT("label", label.c_str(), "use_underline", gboolean(mnemonic))
 {}
 
-} // namespace Gtk
+void CheckButton::unset_group()
+{
+  gtk_check_button_set_group(gobj(), nullptr);
+}
 
+} // namespace Gtk
diff --git a/gtk/src/checkbutton.hg b/gtk/src/checkbutton.hg
index 020e139a..df3a16af 100644
--- a/gtk/src/checkbutton.hg
+++ b/gtk/src/checkbutton.hg
@@ -16,53 +16,62 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <gtkmm/togglebutton.h>
+#include <gtkmm/widget.h>
+#include <gtkmm/actionable.h>
+
 _DEFS(gtkmm,gtk)
-_PINCLUDE(gtkmm/private/togglebutton_p.h)
+_PINCLUDE(gtkmm/private/widget_p.h)
 
 namespace Gtk
 {
 
 /** Create widgets with a discrete toggle button.
  *
- * A Gtk::CheckButton places a discrete Gtk::ToggleButton next to a widget,
- * (usually a Gtk::Label).  See Gtk::ToggleButton widgets for more
- * information about toggle/check buttons.  The important signal,
- * signal_toggled() is also inherited from Gtk::ToggleButton.
+ * A %Gtk::CheckButton places a label next to an indicator.
  *
  * The CheckButton widget looks like this:
  * @image html checkbutton1.png
  *
+ * @see Button, ToggleButton
  * @ingroup Widgets
  */
-class GTKMM_API CheckButton : public ToggleButton
+class GTKMM_API CheckButton : public Widget, public Actionable
 {
-  _CLASS_GTKOBJECT(CheckButton,GtkCheckButton,GTK_CHECK_BUTTON,Gtk::ToggleButton,GtkToggleButton,,,GTKMM_API)
+  _CLASS_GTKOBJECT(CheckButton, GtkCheckButton, GTK_CHECK_BUTTON, Gtk::Widget, GtkWidget,,,GTKMM_API)
+  _IMPLEMENTS_INTERFACE(Actionable)
 public:
 
   /** Create an empty check button.
-   * With an empty button, you can Gtk::Button::add() a widget such as a
-   * Gtk::Image or Gtk::Box.
    *
-   * If you just wish to add a Gtk::Label, you may want to use the
-   * Gtk::CheckButton(const Glib::ustring& label) constructor directly
-   * instead.
+   * If you wish to add a Gtk::Label, you may want to use the
+   * Gtk::CheckButton(const Glib::ustring& label, bool mnemonic)
+   * constructor directly instead.
    */
   _CTOR_DEFAULT
 
   /** Create a check button with a label.
-   * You won't be able to add a widget to this button since it already
-   * contains a Gtk::Label
    */
   explicit CheckButton(const Glib::ustring& label, bool mnemonic = false);
 
-  _WRAP_METHOD(void set_draw_indicator(bool draw_indicator = true), gtk_check_button_set_draw_indicator)
-  _WRAP_METHOD(bool get_draw_indicator() const, gtk_check_button_get_draw_indicator)
   _WRAP_METHOD(void set_inconsistent(bool inconsistent = true), gtk_check_button_set_inconsistent)
   _WRAP_METHOD(bool get_inconsistent() const, gtk_check_button_get_inconsistent)
+  _WRAP_METHOD(void set_active(bool setting = true),gtk_check_button_set_active)
+  _WRAP_METHOD(bool get_active() const,gtk_check_button_get_active)
+  _WRAP_METHOD(void set_label(const Glib::ustring& label), gtk_check_button_set_label)
+  _WRAP_METHOD(Glib::ustring get_label() const, gtk_check_button_get_label)
+  _WRAP_METHOD(void set_use_underline(bool setting = true), gtk_check_button_set_use_underline)
+  _WRAP_METHOD(bool get_use_underline() const, gtk_check_button_get_use_underline)
+
+  _WRAP_METHOD(void set_group(CheckButton& group), gtk_check_button_set_group)
+  void unset_group();
+
+  _WRAP_SIGNAL(void toggled(), "toggled")
 
+  _WRAP_PROPERTY("active", bool)
+  _WRAP_PROPERTY("group", CheckButton*)
+  _WRAP_PROPERTY("label", Glib::ustring)
   _WRAP_PROPERTY("inconsistent", bool)
-  _WRAP_PROPERTY("draw-indicator", bool)
+  _WRAP_PROPERTY("use-underline", bool)
 };
 
 } //namespace Gtk
diff --git a/gtk/src/columnview.hg b/gtk/src/columnview.hg
index ade41a4c..1002391a 100644
--- a/gtk/src/columnview.hg
+++ b/gtk/src/columnview.hg
@@ -16,6 +16,7 @@
 
 #include <gtkmm/widget.h>
 #include <giomm/listmodel.h>
+#include <gtkmm/selectionmodel.h>
 #include <gtkmm/columnviewcolumn.h>
 #include <gtkmm/scrollable.h>
 
@@ -67,7 +68,7 @@ class GTKMM_API ColumnView : public Widget, public Scrollable
   _STRUCT_NOT_HIDDEN
 
 public:
-  _WRAP_CTOR(ColumnView(const Glib::RefPtr<Gio::ListModel>& model = {}), gtk_column_view_new)
+  _WRAP_CTOR(ColumnView(const Glib::RefPtr<SelectionModel>& model = {}), gtk_column_view_new)
 
   _WRAP_METHOD(Glib::RefPtr<Gio::ListModel> get_columns(), gtk_column_view_get_columns, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Gio::ListModel> get_columns() const, gtk_column_view_get_columns, 
refreturn, constversion)
@@ -76,9 +77,9 @@ public:
   _WRAP_METHOD(void remove_column(const Glib::RefPtr<ColumnViewColumn>& column), 
gtk_column_view_remove_column)
   _WRAP_METHOD(void insert_column(guint position, const Glib::RefPtr<ColumnViewColumn>& column), 
gtk_column_view_insert_column)
 
-  _WRAP_METHOD(Glib::RefPtr<Gio::ListModel> get_model(), gtk_column_view_get_model, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Gio::ListModel> get_model() const, gtk_column_view_get_model, refreturn, 
constversion)
-  _WRAP_METHOD(void set_model(const Glib::RefPtr<Gio::ListModel>& model), gtk_column_view_set_model)
+  _WRAP_METHOD(Glib::RefPtr<SelectionModel> get_model(), gtk_column_view_get_model, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const SelectionModel> get_model() const, gtk_column_view_get_model, refreturn, 
constversion)
+  _WRAP_METHOD(void set_model(const Glib::RefPtr<SelectionModel>& model), gtk_column_view_set_model)
 
   _WRAP_METHOD(bool get_show_row_separators() const, gtk_column_view_get_show_row_separators)
   _WRAP_METHOD(void set_show_row_separators(bool show_separators = true), 
gtk_column_view_set_show_row_separators)
@@ -98,7 +99,7 @@ public:
   _WRAP_METHOD(bool get_enable_rubberband() const, gtk_column_view_get_enable_rubberband)
 
   _WRAP_PROPERTY("columns", Glib::RefPtr<Gio::ListModel>)
-  _WRAP_PROPERTY("model", Glib::RefPtr<Gio::ListModel>)
+  _WRAP_PROPERTY("model", Glib::RefPtr<SelectionModel>)
   _WRAP_PROPERTY("show-row-separators", bool)
   _WRAP_PROPERTY("show-column-separators", bool)
   _WRAP_PROPERTY("sorter", Glib::RefPtr<Sorter>)
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index a4db2455..ed4435b2 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -166,7 +166,6 @@ gtkmm_files_any_hg =                \
        printoperationpreview.hg\
        printsettings.hg        \
        progressbar.hg          \
-       radiobutton.hg          \
        range.hg                \
        recentinfo.hg           \
        recentmanager.hg        \
diff --git a/gtk/src/listview.hg b/gtk/src/listview.hg
index 42c68f17..6b4474c2 100644
--- a/gtk/src/listview.hg
+++ b/gtk/src/listview.hg
@@ -15,7 +15,7 @@
  */
 
 #include <gtkmm/listbase.h>
-#include <giomm/listmodel.h>
+#include <gtkmm/selectionmodel.h>
 #include <gtkmm/listitemfactory.h>
 
 _DEFS(gtkmm,gtk)
@@ -81,7 +81,7 @@ namespace Gtk
  *
  *   scrolled_window.set_child(*list);
  * ~~~
- * @see Gio::ListModel, Gtk::ColumnView, Gtk::GridView
+ * @see Gtk::SelectionModel, Gtk::ColumnView, Gtk::GridView
  *
  * @ingroup Widgets
  *
@@ -92,11 +92,11 @@ class GTKMM_API ListView : public ListBase
   _CLASS_GTKOBJECT(ListView, GtkListView, GTK_LIST_VIEW, ListBase, GtkListBase, , , GTKMM_API)
 
 public:
-  _WRAP_CTOR(ListView(const Glib::RefPtr<Gio::ListModel>& model = {}, const Glib::RefPtr<ListItemFactory>& 
factory = {}), gtk_list_view_new_with_factory)
+  _WRAP_CTOR(ListView(const Glib::RefPtr<SelectionModel>& model = {}, const Glib::RefPtr<ListItemFactory>& 
factory = {}), gtk_list_view_new)
 
-  _WRAP_METHOD(Glib::RefPtr<Gio::ListModel> get_model(), gtk_list_view_get_model, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Gio::ListModel> get_model() const, gtk_list_view_get_model, refreturn, 
constversion)
-  _WRAP_METHOD(void set_model(const Glib::RefPtr<Gio::ListModel>& model), gtk_list_view_set_model)
+  _WRAP_METHOD(Glib::RefPtr<SelectionModel> get_model(), gtk_list_view_get_model, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const SelectionModel> get_model() const, gtk_list_view_get_model, refreturn, 
constversion)
+  _WRAP_METHOD(void set_model(const Glib::RefPtr<SelectionModel>& model), gtk_list_view_set_model)
   _WRAP_METHOD(void set_factory(const Glib::RefPtr<ListItemFactory>& factory), gtk_list_view_set_factory)
   _WRAP_METHOD(Glib::RefPtr<ListItemFactory> get_factory(), gtk_list_view_get_factory, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const ListItemFactory> get_factory() const, gtk_list_view_get_factory, 
refreturn, constversion)
@@ -108,13 +108,13 @@ public:
   _WRAP_METHOD(bool get_enable_rubberband() const, gtk_list_view_get_enable_rubberband)
 
   _WRAP_PROPERTY("factory", Glib::RefPtr<ListItemFactory>)
-  _WRAP_PROPERTY("model", Glib::RefPtr<Gio::ListModel>)
+  _WRAP_PROPERTY("model", Glib::RefPtr<SelectionModel>)
   _WRAP_PROPERTY("show-separators", bool)
   _WRAP_PROPERTY("single-click-activate", bool)
   _WRAP_PROPERTY("enable-rubberband", bool)
 
   // no_default_handler because GtkListViewClass is private.
-  _WRAP_SIGNAL(void activate(guint pos), "activate", no_default_handler)
+  _WRAP_SIGNAL(void activate(guint position), "activate", no_default_handler)
 };
 
 } // namespace Gtk
diff --git a/gtk/src/togglebutton.ccg b/gtk/src/togglebutton.ccg
index 4b514b46..63f3dd8b 100644
--- a/gtk/src/togglebutton.ccg
+++ b/gtk/src/togglebutton.ccg
@@ -26,4 +26,9 @@ ToggleButton::ToggleButton(const Glib::ustring& label, bool mnemonic)
   _CONSTRUCT("label", label.c_str(), "use_underline", gboolean(mnemonic))
 {}
 
+void ToggleButton::unset_group()
+{
+  gtk_toggle_button_set_group(gobj(), nullptr);
+}
+
 } // namespace Gtk
diff --git a/gtk/src/togglebutton.hg b/gtk/src/togglebutton.hg
index 788019ae..51b39c75 100644
--- a/gtk/src/togglebutton.hg
+++ b/gtk/src/togglebutton.hg
@@ -23,15 +23,23 @@ _PINCLUDE(gtkmm/private/button_p.h)
 namespace Gtk
 {
 
-/** A Gtk::ToggleButton will remain 'pressed-in' when clicked. Clicking again will cause the toggle button 
to return to it's normal state.
- * The state of a Gtk::ToggleButton can be set specifically using set_active(), and retrieved using 
get_active().
- * To simply switch the state of a toggle button, use toggled().
+/** Create buttons which retain their state.
  *
+ * A %Gtk::ToggleButton is a Gtk::Button which will remain “pressed-in” when
+ * clicked. Clicking again will cause the toggle button to return to its
+ * normal state.
+ *
+ * The state of a %Gtk::ToggleButton can be set specifically using
+ * set_active(), and retrieved using get_active().
+ *
+ * To simply switch the state of a toggle button, use gtk_toggle_button_toggled().
+ *
+ * @see Button, Checkbutton
  * @ingroup Widgets
  */
 class GTKMM_API ToggleButton : public Button
 {
-  _CLASS_GTKOBJECT(ToggleButton,GtkToggleButton,GTK_TOGGLE_BUTTON,Gtk::Button,GtkButton,,,GTKMM_API)
+  _CLASS_GTKOBJECT(ToggleButton, GtkToggleButton, GTK_TOGGLE_BUTTON, Gtk::Button, GtkButton,,,GTKMM_API)
 public:
 
   /** Create an empty toggle button.
@@ -39,14 +47,14 @@ public:
    * Gtk::Image or Gtk::Box.
    *
    * If you just wish to add a Gtk::Label, you may want to use the
-   * Gtk::ToggleButton(const Glib::ustring &label) constructor directly
-   * instead.
+   * Gtk::ToggleButton(const Glib::ustring &label, bool mnemonic)
+   * constructor directly instead.
    */
   _CTOR_DEFAULT
 
   /** Create a toggle button with a label.
-   * You won't be able
-   * to add a widget to this button since it already contains a Gtk::Label
+   * You won't be able to add a widget to this button since it
+   * already contains a Gtk::Label.
    */
   explicit ToggleButton(const Glib::ustring& label, bool mnemonic = false);
 
@@ -55,9 +63,13 @@ public:
 
   _WRAP_METHOD(void toggled(), gtk_toggle_button_toggled)
 
+  _WRAP_METHOD(void set_group(ToggleButton& group), gtk_toggle_button_set_group)
+  void unset_group();
+
   _WRAP_SIGNAL(void toggled(), "toggled")
 
   _WRAP_PROPERTY("active", bool)
+  _WRAP_PROPERTY("group", ToggleButton*)
 };
 
 } //namespace Gtk
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 9af2fdc2..b1e9a4e8 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -210,7 +210,6 @@ _CONVERSION(`GtkWidget*',`Entry*',`Glib::wrap((GtkEntry*)($3))')
 _CONVERSION(`GtkWidget*',`HeaderBar*',`Glib::wrap((GtkHeaderBar*)($3))')
 _CONVERSION(`GtkWidget*',`Label*',`Glib::wrap((GtkLabel*)($3))')
 _CONVERSION(`GtkWidget*',`Popover*',`Glib::wrap((GtkPopover*)($3))')
-_CONVERSION(`GtkWidget*',`RadioButton*',`Glib::wrap((GtkRadioButton*)($3))')
 _CONVERSION(`GtkWidget*',`Gtk::Scrollbar*',__RP2PD)
 _CONVERSION(`GtkWidget*',`Gtk::Tree*',__RP2PD)
 _CONVERSION(`GtkWidget*',`ScrolledWindow*',`Glib::wrap((GtkScrolledWindow*)($3))')
@@ -227,7 +226,6 @@ _CONVERSION(`GtkWidget*',`const Gtk::CheckButton*',__RP2CPD)
 _CONVERSION(`GtkWidget*',`const Entry*',`Glib::wrap((GtkEntry*)($3))')
 _CONVERSION(`GtkWidget*',`const Label*',`Glib::wrap((GtkLabel*)($3))')
 _CONVERSION(`GtkWidget*',`const Popover*',`Glib::wrap((GtkPopover*)($3))')
-_CONVERSION(`GtkWidget*',`const RadioButton*',`Glib::wrap((GtkRadioButton*)($3))')
 _CONVERSION(`GtkWidget*',`const Gtk::Scrollbar*',__RP2CPD)
 _CONVERSION(`GtkWidget*',`const Gtk::Tree*',__RP2CPD)
 _CONVERSION(`GtkWidget*',`const ScrolledWindow*',`Glib::wrap((GtkScrolledWindow*)($3))')
@@ -235,8 +233,6 @@ _CONVERSION(`GtkWidget*',`const Window*',`Glib::wrap((GtkWindow*)($3))')
 _CONVERSION(`GtkWidget*',`const TreeView*',`Glib::wrap((GtkTreeView*)($3))')
 _CONVERSION(`GtkWidget*',`const FileChooserDialog*',`Glib::wrap((GtkFileChooserDialog*)($3))')
 
-_CONVERSION(`RadioButton&',`GtkRadioButton*',`($3).gobj()')
-
 # Ptr (gtk+) -> Ref (Gtkmm)
 _CONVERSION(`GtkWidget*', `Widget&', `*Glib::wrap($3)')
 _CONVERSION(`GtkWidget*', `const Widget&', `*Glib::wrap($3)')
@@ -257,6 +253,8 @@ _CONVERSION(`CellRenderer&',`GtkCellRenderer*',__FR2P)
 _CONVERSION(`const CellRenderer&',`GtkCellRenderer*',__FCR2P)
 _CONVERSION(`Gtk::Entry&',`GtkEntry*',__FR2P)
 _CONVERSION(`Stack&',`GtkStack*',__FR2P)
+_CONVERSION(`CheckButton&',`GtkCheckButton*',__FR2P)
+_CONVERSION(`ToggleButton&',`GtkToggleButton*',__FR2P)
 
 _CONVERSION(`const Widget&',`GtkWidget*',__FCR2P)
 
@@ -562,6 +560,7 @@ _CONVERSION(`GListModel*',`Glib::RefPtr<Gio::ListModel>',`Glib::wrap($3)')
 _CONVERSION(`GListModel*',`Glib::RefPtr<const Gio::ListModel>',`Glib::wrap($3)')
 _CONVERSION(`const Glib::RefPtr<Gio::ListModel>&',`GListModel*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`GtkSelectionModel*',`Glib::RefPtr<SelectionModel>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<SelectionModel>&',`GtkSelectionModel*',__CONVERT_REFPTR_TO_P)
 
 _CONVERSION(`const Glib::RefPtr<const Bitset>&',`GtkBitset*',__CONVERT_CONST_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Bitset>&',`const GtkBitset*',__CONVERT_REFPTR_TO_P)


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