[gtkmm-documentation] Update after Gtk::RadioButton has been removed



commit 39d05d92aece9ff0153f73047e93bd2dbca896f4
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Thu Sep 3 16:11:45 2020 +0200

    Update after Gtk::RadioButton has been removed
    
    The RadioButton class has been removed. CheckButtons and ToggleButtons
    act as radio buttons, if they make up a group.
    Update example programs and the Buttons chapter.

 docs/tutorial/C/index-in.docbook                   | 122 ++++++---------------
 examples/book/buttons/checkbutton/examplewindow.cc |   8 +-
 examples/book/buttons/checkbutton/examplewindow.h  |   4 +-
 examples/book/buttons/radiobutton/radiobuttons.cc  |  14 +--
 examples/book/buttons/radiobutton/radiobuttons.h   |   7 +-
 .../book/keyboard_events/simple/examplewindow.cc   |   2 +-
 .../book/keyboard_events/simple/examplewindow.h    |   4 +-
 examples/book/popover/examplewindow.cc             |   6 +-
 examples/book/popover/examplewindow.h              |   2 +-
 examples/book/progressbar/examplewindow.cc         |   6 +-
 examples/book/spinbutton/examplewindow.cc          |   5 +-
 examples/book/toolbar/examplewindow.cc             |  13 ++-
 examples/book/tooltips/examplewindow.cc            |   8 +-
 examples/book/tooltips/examplewindow.h             |   2 +-
 14 files changed, 76 insertions(+), 127 deletions(-)
---
diff --git a/docs/tutorial/C/index-in.docbook b/docs/tutorial/C/index-in.docbook
index d6c0eb47..6cb10bbc 100644
--- a/docs/tutorial/C/index-in.docbook
+++ b/docs/tutorial/C/index-in.docbook
@@ -764,8 +764,8 @@ when porting code that used &gtkmm;-3.0 and <application>glibmm</application>-2.
   <classname>Glib::ListHandle</classname> and <classname>Glib::SListHandle</classname> have been removed.
   They were used in <application>glibmm</application>-2.4, but not used in &gtkmm;-3.0.
   If you've ever used these classes, replace them with a standard C++ container, such as 
<classname>std::vector</classname>.</simpara></listitem>
-<listitem><simpara><methodname>Gtk::Container::show_all_children()</methodname> and
-  <methodname>Gtk::Widget::show_all()</methodname> have been removed. The default value
+<listitem><simpara><classname>Gtk::Container</classname> has been removed.</simpara></listitem>
+<listitem><simpara><methodname>Gtk::Widget::show_all()</methodname> has been removed. The default value
   of <methodname>Gtk::Widget::property_visible()</methodname>has been changed from
   <literal>false</literal> to <literal>true</literal>.</simpara></listitem>
 <listitem><simpara>All event signals have been removed from <classname>Gtk::Widget</classname>.
@@ -786,6 +786,9 @@ when porting code that used &gtkmm;-3.0 and <application>glibmm</application>-2.
   <methodname>insert_child_after()</methodname> and <methodname>insert_child_at_start()</methodname>.
   </simpara></listitem>
 <listitem><simpara><classname>Gtk::ButtonBox</classname> has been removed.</simpara></listitem>
+<listitem><simpara><classname>Gtk::RadioButton</classname> and <classname>Gtk::RadioButtonGroup</classname>
+  have been removed. Use <classname>Gtk::CheckButton</classname> or <classname>Gtk::ToggleButton</classname>
+  with <methodname>set_group()</methodname>.</simpara></listitem>
 </orderedlist>
 </para>
 
@@ -849,21 +852,21 @@ See the <link linkend="sec-checkbuttons">CheckButton</link> section.
 <term>Radio buttons</term>
 <listitem>
 <para>
-<ulink url="&url_refdocs_base_gtk;RadioButton.html"><classname>Gtk::RadioButton</classname></ulink>.
 Named after the station selectors on old car
 radios, these buttons are used in groups for options which are
 mutually exclusive. Pressing one causes all the
-others in its group to turn off. They are similar to
+others in its group to turn off. They are similar to ToggleButtons or
 CheckButtons (a small widget with a label at the side), but usually
-look different.
-See the <link linkend="sec-radio-buttons">RadioButton</link> section.
+look different. There is no separate radio button class. Check buttons
+and toggle buttons can act as radio buttons.
+See the <link linkend="sec-radio-buttons">Radio Button</link> section.
 </para>
 </listitem>
 </varlistentry>
 </variablelist>
 
 <para>
-Note that, due to GTK+'s theming system, the appearance of these
+Note that, due to GTK's theming system, the appearance of these
 widgets will vary. In the case of check buttons and radio buttons, they
 may vary considerably.
 </para>
@@ -930,12 +933,6 @@ You can use the <methodname>toggled()</methodname> method to toggle the button,
 forcing it to be up or down: This switches the button's state, and causes the <literal>toggled</literal> 
signal to be emitted.
 </para>
 
-<para>
-<classname>Gtk::ToggleButton</classname> is most useful as a base class for the
-<classname>Gtk::CheckButton</classname> and
-<classname>Gtk::RadioButton</classname> classes.
-</para>
-
 <para><ulink url="&url_refdocs_base_gtk;ToggleButton.html">Reference</ulink></para>
 
 </sect1>
@@ -944,10 +941,10 @@ forcing it to be up or down: This switches the button's state, and causes the <l
 <title>CheckButton</title>
 
 <para>
-<classname>Gtk::CheckButton</classname> inherits from
-<classname>Gtk::ToggleButton</classname>. The only real difference between the
-two is <classname>Gtk::CheckButton</classname>'s
-appearance. You can check, set, and toggle a check button using the same
+<classname>Gtk::CheckButton</classname> inherits directly from
+<classname>Gtk::Widget</classname>. It is similar to <classname>Gtk::ToggleButton</classname>.
+The only real difference between the two is <classname>Gtk::CheckButton</classname>'s
+appearance. You can check and set a check button using the same
 member methods as for <classname>Gtk::ToggleButton</classname>.
 </para>
 
@@ -968,91 +965,42 @@ member methods as for <classname>Gtk::ToggleButton</classname>.
 </sect1>
 
 <sect1 id="sec-radio-buttons">
-<title>RadioButton</title>
+<title>Radio Button</title>
 
 <para>
-Like check buttons, radio buttons also inherit from
-<classname>Gtk::ToggleButton</classname>, but these work in groups, and only
-one RadioButton in a group can be selected at any one time.
+There is no separate class for radio buttons. Check buttons and toggle buttons
+act as radio buttons when they form a group. Only one button in a group can be
+selected at any one time.
 </para>
 
 <sect2 id="radiobutton-groups"><title>Groups</title>
 <para>
-There are two ways to set up a group of radio buttons. The first way
-is to create the buttons, and set up their groups afterwards. Only
-the constructors without a <classname>Gtk::RadioButton::Group</classname>
-parameter are used. In the following example, we put 3 radio buttons in a group:
-</para>
-
-<programlisting>
-auto rb1 = Gtk::make_managed&lt;Gtk::RadioButton&gt;("button1");
-auto rb2 = Gtk::make_managed&lt;Gtk::RadioButton&gt;("button2");
-auto rb3 = Gtk::make_managed&lt;Gtk::RadioButton&gt;("button3");
-rb2-&gt;join_group(*rb1);
-rb3-&gt;join_group(*rb1);
-</programlisting>
-
-<para>
-We told &gtkmm; to put all three <classname>RadioButton</classname>s in the
-same group by using <methodname>join_group()</methodname> to tell the other
-<classname>RadioButton</classname>s to share group with the first
-<classname>RadioButton</classname>.
-</para>
-
-<para>
-The purpose of <methodname>join_group()</methodname> is to make it easier to
-express that you want a given button to use a group established by another.
-There is another way to do this, using <methodname>get_group()</methodname>
-and <methodname>set_group()</methodname>. However, this has a pitfall:
-Note that you can't do
-<programlisting>rb2-&gt;set_group(rb1-&gt;get_group());</programlisting>
-because <methodname>get_group()</methodname> returns a <classname>RadioButton::Group</classname>
-by value, and an unnamed rvalue cannot be passed as the lvalue reference needed
-by <methodname>set_group()</methodname>. Instead, you must assign the result of
-<methodname>get_group()</methodname> to a variable and pass that to
-<methodname>set_group()</methodname> as an lvalue:
+You create the buttons, and set up their group afterwards. In the following example,
+we put 3 radio buttons in a group:
 </para>
 
 <programlisting>
-auto rb1 = Gtk::make_managed&lt;Gtk::RadioButton&gt;("button1");
-auto rb2 = Gtk::make_managed&lt;Gtk::RadioButton&gt;("button2");
-auto rb3 = Gtk::make_managed&lt;Gtk::RadioButton&gt;("button3");
-auto group = rb1-&gt;get_group();
-rb2-&gt;set_group(group);
-rb3-&gt;set_group(group);
+auto rb1 = Gtk::make_managed&lt;Gtk::CheckButton&gt;("button1");
+auto rb2 = Gtk::make_managed&lt;Gtk::CheckButton&gt;("button2");
+auto rb3 = Gtk::make_managed&lt;Gtk::CheckButton&gt;("button3");
+rb2-&gt;set_group(*rb1);
+rb3-&gt;set_group(*rb1);
 </programlisting>
 
 <para>
-This works because the group is really a handle and therefore can be discarded
-once it has been used to tell the radio buttons to group with each other. Still,
-as <methodname>join_group()</methodname> does the same thing in one less line,
-you might not find much use for this pattern, but it is shown for completeness.
-</para>
-
-<para>
-The second way to set up radio buttons is to make a group first, and
-then add radio buttons to it. Here's an example:
+We told &gtkmm; to put all three <classname>CheckButton</classname>s in the
+same group by using <methodname>set_group()</methodname> to tell the other
+<classname>CheckButton</classname>s to share group with the first
+<classname>CheckButton</classname>.
 </para>
 
-<programlisting>
-Gtk::RadioButton::Group group;
-auto rb1 = Gtk::make_managed&lt;Gtk::RadioButton&gt;(group, "button1");
-auto rb2 = Gtk::make_managed&lt;Gtk::RadioButton&gt;(group, "button2");
-auto rb3 = Gtk::make_managed&lt;Gtk::RadioButton&gt;(group, "button3");
-</programlisting>
-
-<para>
-We made a new group by simply declaring a variable, <literal>group</literal>,
-of type <classname>Gtk::RadioButton::Group</classname>. Then we made three radio
-buttons, using a constructor to make each of them part of <literal>group</literal>.
-</para>
 </sect2>
 
 <sect2 id="radiobutton-methods"><title>Methods</title>
 <para>
-<classname>RadioButtons</classname> are "off" when created; this means that
-when you first make a group of them, they will all be off. Don't forget to turn
-one of them on using <methodname>set_active()</methodname>.
+<classname>CheckButton</classname>s and <classname>ToggleButton</classname>s are "off"
+when created; this means that when you first make a group of them, they will all be off.
+Don't forget to turn one of them on using <methodname>set_active()</methodname>.
 </para>
 
 <para><ulink url="&url_refdocs_base_gtk;RadioButton.html">Reference</ulink></para>
@@ -1061,8 +1009,8 @@ one of them on using <methodname>set_active()</methodname>.
 
 <sect2 id="radiobutton-example"><title>Example</title>
 <para>
-The following example demonstrates the use of
-<classname>RadioButton</classname>s:
+The following example demonstrates the use of grouped
+<classname>CheckButton</classname>s:
 </para>
 
 <figure id="figure-radiobutton">
@@ -1710,7 +1658,7 @@ two child widgets, but the number is fixed so it seems appropriate.
 <para>
 Frames can enclose one or a group of widgets within a box, optionally with a
 title. For instance, you might place a group of
-<classname>RadioButton</classname>s or <classname>CheckButton</classname>s in a
+<classname>ToggleButton</classname>s or <classname>CheckButton</classname>s in a
 <classname>Frame</classname>.
 </para>
 
diff --git a/examples/book/buttons/checkbutton/examplewindow.cc 
b/examples/book/buttons/checkbutton/examplewindow.cc
index e4fafc0b..f84da7c1 100644
--- a/examples/book/buttons/checkbutton/examplewindow.cc
+++ b/examples/book/buttons/checkbutton/examplewindow.cc
@@ -22,8 +22,8 @@ ExampleWindow::ExampleWindow()
 {
   set_title("checkbutton example");
 
-  m_button.signal_clicked().connect(sigc::mem_fun(*this,
-              &ExampleWindow::on_button_clicked) );
+  m_button.signal_toggled().connect(sigc::mem_fun(*this,
+              &ExampleWindow::on_button_toggled) );
 
   m_button.set_margin(10);
   set_child(m_button);
@@ -33,9 +33,9 @@ ExampleWindow::~ExampleWindow()
 {
 }
 
-void ExampleWindow::on_button_clicked()
+void ExampleWindow::on_button_toggled()
 {
-  std::cout << "The Button was clicked: state="
+  std::cout << "The Button was toggled: state="
       << (m_button.get_active() ? "true" : "false")
       << std::endl;
 }
diff --git a/examples/book/buttons/checkbutton/examplewindow.h 
b/examples/book/buttons/checkbutton/examplewindow.h
index 981c89a6..ed31f615 100644
--- a/examples/book/buttons/checkbutton/examplewindow.h
+++ b/examples/book/buttons/checkbutton/examplewindow.h
@@ -1,5 +1,3 @@
-//$Id: examplewindow.h 2 2003-01-21 13:41:59Z murrayc $ -*- c++ -*-
-
 /* gtkmm example Copyright (C) 2002 gtkmm development team
  *
  * This program is free software; you can redistribute it and/or modify
@@ -30,7 +28,7 @@ public:
 
 protected:
   //Signal handlers:
-  void on_button_clicked();
+  void on_button_toggled();
 
   //Child widgets:
   Gtk::CheckButton m_button;
diff --git a/examples/book/buttons/radiobutton/radiobuttons.cc 
b/examples/book/buttons/radiobutton/radiobuttons.cc
index e5f7d7a4..602b85f8 100644
--- a/examples/book/buttons/radiobutton/radiobuttons.cc
+++ b/examples/book/buttons/radiobutton/radiobuttons.cc
@@ -16,7 +16,6 @@
 
 #include "radiobuttons.h"
 
-
 RadioButtons::RadioButtons() :
   m_Box_Top(Gtk::Orientation::VERTICAL),
   m_Box1(Gtk::Orientation::VERTICAL, 10),
@@ -29,9 +28,12 @@ RadioButtons::RadioButtons() :
   // Set title and border of the window
   set_title("radio buttons");
 
+  // Gtk::CheckButton and Gtk::ToggleButton have set_group() methods.
+  // They act as radio buttons, if they are included in a group.
+
   // Put radio buttons 2 and 3 in the same group as 1:
-  m_RadioButton2.join_group(m_RadioButton1);
-  m_RadioButton3.join_group(m_RadioButton1);
+  m_RadioButton2.set_group(m_RadioButton1);
+  m_RadioButton3.set_group(m_RadioButton1);
 
   // Add outer box to the window (because the window
   // can only contain a single widget)
@@ -56,9 +58,7 @@ RadioButtons::RadioButtons() :
   m_RadioButton3.set_expand();
 
   // Set the second button active
-  m_RadioButton1.set_active(false);
   m_RadioButton2.set_active(true);
-  m_RadioButton3.set_active(false);
 
   // Put Close button in Box2:
   m_Box2.append(m_Button_Close);
@@ -67,8 +67,8 @@ RadioButtons::RadioButtons() :
   // Make the button the default widget
   set_default_widget(m_Button_Close);
 
-  // Connect the clicked signal of the button to
-  // RadioButtons::on_button_clicked()
+  // Connect the toggled signal of the button to
+  // RadioButtons::on_button_toggled()
   m_Button_Close.signal_clicked().connect(sigc::mem_fun(*this,
               &RadioButtons::on_button_clicked) );
 }
diff --git a/examples/book/buttons/radiobutton/radiobuttons.h 
b/examples/book/buttons/radiobutton/radiobuttons.h
index 143a63f2..2aa4e583 100644
--- a/examples/book/buttons/radiobutton/radiobuttons.h
+++ b/examples/book/buttons/radiobutton/radiobuttons.h
@@ -1,5 +1,3 @@
-//$Id: radiobuttons.h 2 2003-01-21 13:41:59Z murrayc $ -*- c++ -*-
-
 /* gtkmm example Copyright (C) 2002 gtkmm development team
  *
  * This program is free software; you can redistribute it and/or modify
@@ -21,7 +19,8 @@
 
 #include <gtkmm/box.h>
 #include <gtkmm/window.h>
-#include <gtkmm/radiobutton.h>
+#include <gtkmm/button.h>
+#include <gtkmm/checkbutton.h>
 #include <gtkmm/separator.h>
 
 class RadioButtons : public Gtk::Window
@@ -36,7 +35,7 @@ protected:
 
   //Child widgets:
   Gtk::Box m_Box_Top, m_Box1, m_Box2;
-  Gtk::RadioButton m_RadioButton1, m_RadioButton2, m_RadioButton3;
+  Gtk::CheckButton m_RadioButton1, m_RadioButton2, m_RadioButton3;
   Gtk::Separator m_Separator;
   Gtk::Button m_Button_Close;
 };
diff --git a/examples/book/keyboard_events/simple/examplewindow.cc 
b/examples/book/keyboard_events/simple/examplewindow.cc
index 9c9d85e4..e96b105d 100644
--- a/examples/book/keyboard_events/simple/examplewindow.cc
+++ b/examples/book/keyboard_events/simple/examplewindow.cc
@@ -26,7 +26,7 @@ ExampleWindow::ExampleWindow()
   m_first.set_label("First");
   m_second.set_label("Second");
 
-  m_second.join_group(m_first);
+  m_second.set_group(m_first);
   m_first.set_active();
 
   // Main Container:
diff --git a/examples/book/keyboard_events/simple/examplewindow.h 
b/examples/book/keyboard_events/simple/examplewindow.h
index 4f04f838..1f9b9d54 100644
--- a/examples/book/keyboard_events/simple/examplewindow.h
+++ b/examples/book/keyboard_events/simple/examplewindow.h
@@ -31,8 +31,8 @@ private:
   bool on_window_key_pressed(guint keyval, guint keycode, Gdk::ModifierType state);
 
   Gtk::Box m_container;
-  Gtk::RadioButton m_first;
-  Gtk::RadioButton m_second;
+  Gtk::CheckButton m_first;
+  Gtk::CheckButton m_second;
 };
 
 #endif //GTKMM_EXAMPLEWINDOW_H
diff --git a/examples/book/popover/examplewindow.cc b/examples/book/popover/examplewindow.cc
index 0b9f3e4c..617e390e 100644
--- a/examples/book/popover/examplewindow.cc
+++ b/examples/book/popover/examplewindow.cc
@@ -77,12 +77,12 @@ void ExampleWindow::configure_form_buttons()
   m_toggle_form_buttons[1].set_image_from_icon_name("format-justify-center-symbolic", 
Gtk::IconSize::INHERIT, true);
   m_toggle_form_buttons[2].set_image_from_icon_name("format-justify-right-symbolic", Gtk::IconSize::INHERIT, 
true);
 
-  m_toggle_form_buttons[1].join_group(m_toggle_form_buttons[0]);
-  m_toggle_form_buttons[2].join_group(m_toggle_form_buttons[0]);
+  m_toggle_form_buttons[0].set_active();
+  m_toggle_form_buttons[1].set_group(m_toggle_form_buttons[0]);
+  m_toggle_form_buttons[2].set_group(m_toggle_form_buttons[0]);
 
   for (auto& button : m_toggle_form_buttons)
   {
-    button.set_draw_indicator(false);
     button.set_expand(true);
     m_format_buttons_box.append(button);
   }
diff --git a/examples/book/popover/examplewindow.h b/examples/book/popover/examplewindow.h
index 271849c5..f1753987 100644
--- a/examples/book/popover/examplewindow.h
+++ b/examples/book/popover/examplewindow.h
@@ -43,7 +43,7 @@ protected:
 
   Gtk::Popover m_toggle_form_popover;
   Gtk::Label m_toggle_form_label;
-  Gtk::RadioButton m_toggle_form_buttons[3];
+  Gtk::ToggleButton m_toggle_form_buttons[3];
   Gtk::Label m_toggle_form_combo_label;
   Gtk::ComboBoxText m_toggle_form_combo;
 
diff --git a/examples/book/progressbar/examplewindow.cc b/examples/book/progressbar/examplewindow.cc
index b04bf6a3..4907435a 100644
--- a/examples/book/progressbar/examplewindow.cc
+++ b/examples/book/progressbar/examplewindow.cc
@@ -51,19 +51,19 @@ ExampleWindow::ExampleWindow()
   //Add a check button to select displaying of the trough text:
   m_Grid.attach(m_CheckButton_Text, 0, 0);
   m_CheckButton_Text.set_margin(5);
-  m_CheckButton_Text.signal_clicked().connect(sigc::mem_fun(*this,
+  m_CheckButton_Text.signal_toggled().connect(sigc::mem_fun(*this,
               &ExampleWindow::on_checkbutton_text) );
 
   //Add a check button to toggle activity mode:
   m_Grid.attach(m_CheckButton_Activity, 0, 1);
   m_CheckButton_Activity.set_margin(5);
-  m_CheckButton_Activity.signal_clicked().connect(sigc::mem_fun(*this,
+  m_CheckButton_Activity.signal_toggled().connect(sigc::mem_fun(*this,
               &ExampleWindow::on_checkbutton_activity) );
 
   //Add a check button to select growth from left to right or from right to left:
   m_Grid.attach(m_CheckButton_Inverted, 0, 2);
   m_CheckButton_Inverted.set_margin(5);
-  m_CheckButton_Inverted.signal_clicked().connect(sigc::mem_fun(*this,
+  m_CheckButton_Inverted.signal_toggled().connect(sigc::mem_fun(*this,
               &ExampleWindow::on_checkbutton_inverted) );
 
   //Add a button to exit the program.
diff --git a/examples/book/spinbutton/examplewindow.cc b/examples/book/spinbutton/examplewindow.cc
index ddf5ebc5..9547e7f9 100644
--- a/examples/book/spinbutton/examplewindow.cc
+++ b/examples/book/spinbutton/examplewindow.cc
@@ -130,16 +130,15 @@ ExampleWindow::ExampleWindow()
   m_VBox_Accelerated.append(m_CheckButton_Snap);
   m_CheckButton_Snap.set_expand();
   m_CheckButton_Snap.set_active();
-  m_CheckButton_Snap.signal_clicked().connect( sigc::mem_fun(*this,
+  m_CheckButton_Snap.signal_toggled().connect( sigc::mem_fun(*this,
               &ExampleWindow::on_checkbutton_snap) );
 
   m_VBox_Accelerated.append(m_CheckButton_Numeric);
   m_CheckButton_Numeric.set_expand();
   m_CheckButton_Numeric.set_active();
-  m_CheckButton_Numeric.signal_clicked().connect( sigc::mem_fun(*this,
+  m_CheckButton_Numeric.signal_toggled().connect( sigc::mem_fun(*this,
               &ExampleWindow::on_checkbutton_numeric) );
 
-
   //Buttons:
   m_VBox_Accelerated.append(m_HBox_Buttons);
 
diff --git a/examples/book/toolbar/examplewindow.cc b/examples/book/toolbar/examplewindow.cc
index 585233be..7526daa3 100644
--- a/examples/book/toolbar/examplewindow.cc
+++ b/examples/book/toolbar/examplewindow.cc
@@ -68,10 +68,15 @@ ExampleWindow::ExampleWindow()
     item->signal_clicked().connect( sigc::mem_fun(*this,
                 &ExampleWindow::on_toolbar_item) );
 
-    Gtk::RadioButtonGroup group;
-    m_Toolbar.append(*Gtk::make_managed<Gtk::RadioButton>(group, "Radio 1"));
-    m_Toolbar.append(*Gtk::make_managed<Gtk::RadioButton>(group, "Radio 2"));
-    m_Toolbar.append(*Gtk::make_managed<Gtk::RadioButton>(group, "Radio 3"));
+    auto radio1 = Gtk::make_managed<Gtk::ToggleButton>("Radio 1");
+    auto radio2 = Gtk::make_managed<Gtk::ToggleButton>("Radio 2");
+    auto radio3 = Gtk::make_managed<Gtk::ToggleButton>("Radio 3");
+    m_Toolbar.append(*radio1);
+    m_Toolbar.append(*radio2);
+    m_Toolbar.append(*radio3);
+    radio1->set_active();
+    radio2->set_group(*radio1);
+    radio3->set_group(*radio1);
   }
 }
 
diff --git a/examples/book/tooltips/examplewindow.cc b/examples/book/tooltips/examplewindow.cc
index 65cc62eb..b0de444f 100644
--- a/examples/book/tooltips/examplewindow.cc
+++ b/examples/book/tooltips/examplewindow.cc
@@ -106,8 +106,8 @@ void ExampleWindow::prepare_textview()
 
 void ExampleWindow::connect_signals()
 {
-  m_checkbutton.signal_clicked().connect(
-    sigc::mem_fun(*this, &ExampleWindow::on_markup_checkbutton_click));
+  m_checkbutton.signal_toggled().connect(
+    sigc::mem_fun(*this, &ExampleWindow::on_markup_checkbutton_toggled));
 
   m_text_view.signal_query_tooltip().connect(
     sigc::mem_fun(*this, &ExampleWindow::on_textview_query_tooltip), true);
@@ -116,9 +116,9 @@ void ExampleWindow::connect_signals()
     sigc::mem_fun(*this, &ExampleWindow::on_button_query_tooltip), true);
 }
 
-void ExampleWindow::on_markup_checkbutton_click()
+void ExampleWindow::on_markup_checkbutton_toggled()
 {
-  if (m_checkbutton.get_active() == true)
+  if (m_checkbutton.get_active())
   {
     m_checkbutton.set_tooltip_markup(markedup_tip);
   }
diff --git a/examples/book/tooltips/examplewindow.h b/examples/book/tooltips/examplewindow.h
index 5ab8021e..a0f0bb5d 100644
--- a/examples/book/tooltips/examplewindow.h
+++ b/examples/book/tooltips/examplewindow.h
@@ -33,7 +33,7 @@ protected:
   void connect_signals();
 
   //Signal handlers:
-  void on_markup_checkbutton_click();
+  void on_markup_checkbutton_toggled();
   bool on_textview_query_tooltip(int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Gtk::Tooltip>& 
tooltip);
   bool on_button_query_tooltip(int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Gtk::Tooltip>& 
tooltip);
 


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