[gtkmm-documentation] Update for gtk 3.98.0 and gtkmm 3.97.1



commit 68876300516a485be2e28afb7b4bef0a4ece0b9b
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sat Feb 15 10:34:13 2020 +0100

    Update for gtk 3.98.0 and gtkmm 3.97.1
    
    * configure.ac:
    * meson.build: Require gtkmm >= 3.97.1
    * Examples with toolbars: Replace removed Toolbar and *ToolButton
      by Box and *Button.
    * examples/book/update_ui/examplewindow.cc: Replace
      Gtk::Main:events_pending() and iterator() by Glib::MainContext::pending()
      and MainContext::iteration().
    * examples/others/calendar/calendar.cc: Use Gtk::Calendar::set_show_heading()
      etc. instead of the removed Calendar::DisplayOptions.
      Use Glib::DateTime instead of Glib::Date.

 configure.ac                                      |  2 +-
 examples/book/menus/main_menu/examplewindow.cc    | 12 +++--
 examples/book/menus_and_toolbars/examplewindow.cc |  4 +-
 examples/book/menus_and_toolbars/toolbar.glade    | 25 +++++------
 examples/book/printing/advanced/examplewindow.cc  | 21 ++++-----
 examples/book/printing/simple/examplewindow.cc    | 21 ++++-----
 examples/book/recent_files/examplewindow.cc       | 12 +++--
 examples/book/toolbar/examplewindow.cc            | 28 ++++++------
 examples/book/toolbar/examplewindow.h             |  2 +-
 examples/book/update_ui/examplewindow.cc          | 23 +++++-----
 examples/others/calendar/calendar.cc              | 54 +++++++++--------------
 meson.build                                       |  2 +-
 12 files changed, 92 insertions(+), 114 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 983c876..c95c079 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ AC_PATH_PROG([PERL], [perl], [perl])
 AC_PROG_SED
 
 PKG_CHECK_MODULES([GIOMM], [giomm-2.64 >= 2.63.1])
-PKG_CHECK_MODULES([GTKMM], [gtkmm-4.0  >= 3.95.1])
+PKG_CHECK_MODULES([GTKMM], [gtkmm-4.0  >= 3.97.1])
 MM_PKG_CONFIG_SUBST([GTHREAD_CFLAGS], [--cflags-only-other gthread-2.0])
 
 # glib-compile-resources and C compiler are needed to generate and compile
diff --git a/examples/book/menus/main_menu/examplewindow.cc b/examples/book/menus/main_menu/examplewindow.cc
index 8d2f90f..1b507ac 100644
--- a/examples/book/menus/main_menu/examplewindow.cc
+++ b/examples/book/menus/main_menu/examplewindow.cc
@@ -61,26 +61,24 @@ ExampleWindow::ExampleWindow()
     "<!-- Generated with glade 3.18.3 and then changed manually -->"
     "<interface>"
     "  <requires lib='gtk' version='3.94'/>"
-    "  <object class='GtkToolbar' id='toolbar'>"
+    "  <object class='GtkBox' id='toolbar'>"
     "    <property name='can_focus'>False</property>"
     "    <child>"
-    "      <object class='GtkToolButton' id='toolbutton_new'>"
+    "      <object class='GtkButton' id='toolbutton_new'>"
     "        <property name='can_focus'>False</property>"
     "        <property name='tooltip_text' translatable='yes'>New Standard</property>"
     "        <property name='action_name'>app.newstandard</property>"
     "        <property name='icon_name'>document-new</property>"
     "        <property name='expand'>False</property>"
-    "        <property name='homogeneous'>True</property>"
     "      </object>"
     "    </child>"
     "    <child>"
-    "      <object class='GtkToolButton' id='toolbutton_quit'>"
+    "      <object class='GtkButton' id='toolbutton_quit'>"
     "        <property name='can_focus'>False</property>"
     "        <property name='tooltip_text' translatable='yes'>Quit</property>"
     "        <property name='action_name'>app.quit</property>"
     "        <property name='icon_name'>application-exit</property>"
     "        <property name='expand'>False</property>"
-    "        <property name='homogeneous'>True</property>"
     "      </object>"
     "    </child>"
     "  </object>"
@@ -95,9 +93,9 @@ ExampleWindow::ExampleWindow()
     std::cerr << "Building toolbar failed: " <<  ex.what();
   }
 
-  auto toolbar = m_refBuilder->get_widget<Gtk::Toolbar>("toolbar");
+  auto toolbar = m_refBuilder->get_widget<Gtk::Box>("toolbar");
   if (!toolbar)
-    g_warning("GtkToolbar not found");
+    g_warning("toolbar not found");
   else
     m_Box.add(*toolbar);
 }
diff --git a/examples/book/menus_and_toolbars/examplewindow.cc 
b/examples/book/menus_and_toolbars/examplewindow.cc
index 65352c7..0a7e6be 100644
--- a/examples/book/menus_and_toolbars/examplewindow.cc
+++ b/examples/book/menus_and_toolbars/examplewindow.cc
@@ -140,9 +140,9 @@ ExampleWindow::ExampleWindow(const Glib::RefPtr<Gtk::Application>& app)
   }
 
   //Get the toolbar and add it to a container widget:
-  auto toolbar = m_refBuilder->get_widget<Gtk::Toolbar>("toolbar");
+  auto toolbar = m_refBuilder->get_widget<Gtk::Box>("toolbar");
   if (!toolbar)
-    g_warning("GtkToolbar not found");
+    g_warning("toolbar not found");
   else
     m_Box.add(*toolbar);
 }
diff --git a/examples/book/menus_and_toolbars/toolbar.glade b/examples/book/menus_and_toolbars/toolbar.glade
index e543985..b7c68cb 100644
--- a/examples/book/menus_and_toolbars/toolbar.glade
+++ b/examples/book/menus_and_toolbars/toolbar.glade
@@ -1,41 +1,40 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Generated with glade 3.18.3 and then changed manually -->
 <interface>
-  <requires lib="gtk" version="3.94"/>
-  <object class="GtkImage" id="image_rain">
-    <property name="can_focus">False</property>
-    <property name="resource">/toolbar/rain.png</property>
-  </object>
-  <object class="GtkToolbar" id="toolbar">
+  <requires lib="gtk" version="3.98"/>
+  <object class="GtkBox" id="toolbar">
     <property name="can_focus">False</property>
+    <property name="spacing">3</property>
     <child>
-      <object class="GtkToolButton" id="toolbutton_new">
+      <object class="GtkButton" id="toolbutton_new">
         <property name="can_focus">False</property>
         <property name="tooltip_text" translatable="yes">New</property>
         <property name="action_name">example.new</property>
         <property name="icon_name">document-new</property>
         <property name="expand">False</property>
-        <property name="homogeneous">True</property>
       </object>
     </child>
     <child>
-      <object class="GtkToggleToolButton" id="toolbutton_rain">
+      <object class="GtkToggleButton" id="toolbutton_rain">
         <property name="can_focus">False</property>
         <property name="tooltip_text" translatable="yes">Stay dry in the rain</property>
         <property name="action_name">example.rain</property>
-        <property name="label_widget">image_rain</property>
         <property name="expand">False</property>
-        <property name="homogeneous">True</property>
+        <child>
+          <object class="GtkImage" id="image_rain">
+            <property name="can_focus">False</property>
+            <property name="resource">/toolbar/rain.png</property>
+          </object>
+        </child>
       </object>
     </child>
     <child>
-      <object class="GtkToolButton" id="toolbutton_quit">
+      <object class="GtkButton" id="toolbutton_quit">
         <property name="can_focus">False</property>
         <property name="tooltip_text" translatable="yes">Quit</property>
         <property name="action_name">example.quit</property>
         <property name="icon_name">application-exit</property>
         <property name="expand">False</property>
-        <property name="homogeneous">True</property>
       </object>
     </child>
   </object>
diff --git a/examples/book/printing/advanced/examplewindow.cc 
b/examples/book/printing/advanced/examplewindow.cc
index 159a24f..df82aa2 100644
--- a/examples/book/printing/advanced/examplewindow.cc
+++ b/examples/book/printing/advanced/examplewindow.cc
@@ -155,44 +155,41 @@ void ExampleWindow::build_main_menu(const Glib::RefPtr<Gtk::Application>& app)
   Glib::ustring ui_toolbar_info =
     "<!-- Generated with glade 3.18.3 and then changed manually -->"
     "<interface>"
-      "<requires lib='gtk' version='3.94'/>"
-      "<object class='GtkToolbar' id='toolbar'>"
+      "<requires lib='gtk' version='3.98'/>"
+      "<object class='GtkBox' id='toolbar'>"
         "<property name='can_focus'>False</property>"
+        "<property name='spacing'>3</property>"
         "<child>"
-          "<object class='GtkToolButton' id='toolbutton_new'>"
+          "<object class='GtkButton' id='toolbutton_new'>"
             "<property name='can_focus'>False</property>"
             "<property name='tooltip_text' translatable='yes'>New</property>"
             "<property name='action_name'>example.new</property>"
             "<property name='icon_name'>document-new</property>"
             "<property name='expand'>False</property>"
-            "<property name='homogeneous'>True</property>"
           "</object>"
         "</child>"
         "<child>"
-          "<object class='GtkToolButton' id='toolbutton_print'>"
+          "<object class='GtkButton' id='toolbutton_print'>"
             "<property name='can_focus'>False</property>"
             "<property name='tooltip_text' translatable='yes'>Print</property>"
             "<property name='action_name'>example.print</property>"
             "<property name='icon_name'>document-print</property>"
             "<property name='expand'>False</property>"
-            "<property name='homogeneous'>True</property>"
           "</object>"
         "</child>"
         "<child>"
-          "<object class='GtkSeparatorToolItem' id='separator1'>"
+          "<object class='GtkSeparator' id='separator1'>"
             "<property name='can_focus'>False</property>"
             "<property name='expand'>False</property>"
-            "<property name='homogeneous'>False</property>"
           "</object>"
         "</child>"
         "<child>"
-          "<object class='GtkToolButton' id='toolbutton_quit'>"
+          "<object class='GtkButton' id='toolbutton_quit'>"
             "<property name='can_focus'>False</property>"
             "<property name='tooltip_text' translatable='yes'>Quit</property>"
             "<property name='action_name'>example.quit</property>"
             "<property name='icon_name'>application-exit</property>"
             "<property name='expand'>False</property>"
-            "<property name='homogeneous'>True</property>"
           "</object>"
         "</child>"
       "</object>"
@@ -221,9 +218,9 @@ void ExampleWindow::build_main_menu(const Glib::RefPtr<Gtk::Application>& app)
   }
 
   // Get the toolbar and add it to a container widget:
-  auto toolbar = m_refBuilder->get_widget<Gtk::Toolbar>("toolbar");
+  auto toolbar = m_refBuilder->get_widget<Gtk::Box>("toolbar");
   if (!toolbar)
-    g_warning("GtkToolbar not found");
+    g_warning("toolbar not found");
   else
     m_VBox.add(*toolbar);
 }
diff --git a/examples/book/printing/simple/examplewindow.cc b/examples/book/printing/simple/examplewindow.cc
index 159a24f..df82aa2 100644
--- a/examples/book/printing/simple/examplewindow.cc
+++ b/examples/book/printing/simple/examplewindow.cc
@@ -155,44 +155,41 @@ void ExampleWindow::build_main_menu(const Glib::RefPtr<Gtk::Application>& app)
   Glib::ustring ui_toolbar_info =
     "<!-- Generated with glade 3.18.3 and then changed manually -->"
     "<interface>"
-      "<requires lib='gtk' version='3.94'/>"
-      "<object class='GtkToolbar' id='toolbar'>"
+      "<requires lib='gtk' version='3.98'/>"
+      "<object class='GtkBox' id='toolbar'>"
         "<property name='can_focus'>False</property>"
+        "<property name='spacing'>3</property>"
         "<child>"
-          "<object class='GtkToolButton' id='toolbutton_new'>"
+          "<object class='GtkButton' id='toolbutton_new'>"
             "<property name='can_focus'>False</property>"
             "<property name='tooltip_text' translatable='yes'>New</property>"
             "<property name='action_name'>example.new</property>"
             "<property name='icon_name'>document-new</property>"
             "<property name='expand'>False</property>"
-            "<property name='homogeneous'>True</property>"
           "</object>"
         "</child>"
         "<child>"
-          "<object class='GtkToolButton' id='toolbutton_print'>"
+          "<object class='GtkButton' id='toolbutton_print'>"
             "<property name='can_focus'>False</property>"
             "<property name='tooltip_text' translatable='yes'>Print</property>"
             "<property name='action_name'>example.print</property>"
             "<property name='icon_name'>document-print</property>"
             "<property name='expand'>False</property>"
-            "<property name='homogeneous'>True</property>"
           "</object>"
         "</child>"
         "<child>"
-          "<object class='GtkSeparatorToolItem' id='separator1'>"
+          "<object class='GtkSeparator' id='separator1'>"
             "<property name='can_focus'>False</property>"
             "<property name='expand'>False</property>"
-            "<property name='homogeneous'>False</property>"
           "</object>"
         "</child>"
         "<child>"
-          "<object class='GtkToolButton' id='toolbutton_quit'>"
+          "<object class='GtkButton' id='toolbutton_quit'>"
             "<property name='can_focus'>False</property>"
             "<property name='tooltip_text' translatable='yes'>Quit</property>"
             "<property name='action_name'>example.quit</property>"
             "<property name='icon_name'>application-exit</property>"
             "<property name='expand'>False</property>"
-            "<property name='homogeneous'>True</property>"
           "</object>"
         "</child>"
       "</object>"
@@ -221,9 +218,9 @@ void ExampleWindow::build_main_menu(const Glib::RefPtr<Gtk::Application>& app)
   }
 
   // Get the toolbar and add it to a container widget:
-  auto toolbar = m_refBuilder->get_widget<Gtk::Toolbar>("toolbar");
+  auto toolbar = m_refBuilder->get_widget<Gtk::Box>("toolbar");
   if (!toolbar)
-    g_warning("GtkToolbar not found");
+    g_warning("toolbar not found");
   else
     m_VBox.add(*toolbar);
 }
diff --git a/examples/book/recent_files/examplewindow.cc b/examples/book/recent_files/examplewindow.cc
index 354e8f6..26525fc 100644
--- a/examples/book/recent_files/examplewindow.cc
+++ b/examples/book/recent_files/examplewindow.cc
@@ -77,26 +77,24 @@ ExampleWindow::ExampleWindow(const Glib::RefPtr<Gtk::Application>& app)
     "      </item>"
     "    </submenu>"
     "  </menu>"
-    "  <object class='GtkToolbar' id='toolbar'>"
+    "  <object class='GtkBox' id='toolbar'>"
     "    <property name='can_focus'>False</property>"
     "    <child>"
-    "      <object class='GtkToolButton' id='toolbutton_new'>"
+    "      <object class='GtkButton' id='toolbutton_new'>"
     "        <property name='can_focus'>False</property>"
     "        <property name='tooltip_text' translatable='yes'>New</property>"
     "        <property name='action_name'>example.new</property>"
     "        <property name='icon_name'>document-new</property>"
     "        <property name='expand'>False</property>"
-    "        <property name='homogeneous'>True</property>"
     "      </object>"
     "    </child>"
     "    <child>"
-    "      <object class='GtkToolButton' id='toolbutton_quit'>"
+    "      <object class='GtkButton' id='toolbutton_quit'>"
     "        <property name='can_focus'>False</property>"
     "        <property name='tooltip_text' translatable='yes'>Quit</property>"
     "        <property name='action_name'>example.quit</property>"
     "        <property name='icon_name'>application-exit</property>"
     "        <property name='expand'>False</property>"
-    "        <property name='homogeneous'>True</property>"
     "      </object>"
     "    </child>"
     "  </object>"
@@ -123,12 +121,12 @@ ExampleWindow::ExampleWindow(const Glib::RefPtr<Gtk::Application>& app)
   else
     g_warning("GMenu not found");
 
-  auto pToolbar = m_refBuilder->get_widget<Gtk::Toolbar>("toolbar");
+  auto pToolbar = m_refBuilder->get_widget<Gtk::Box>("toolbar");
   if (pToolbar)
     //Toolbar:
     m_Box.add(*pToolbar);
   else
-    g_warning("GtkToolbar not found");
+    g_warning("toolbar not found");
 }
 
 ExampleWindow::~ExampleWindow()
diff --git a/examples/book/toolbar/examplewindow.cc b/examples/book/toolbar/examplewindow.cc
index 4a8fe2b..fcd18c5 100644
--- a/examples/book/toolbar/examplewindow.cc
+++ b/examples/book/toolbar/examplewindow.cc
@@ -46,34 +46,32 @@ ExampleWindow::ExampleWindow()
     //toolbars together, because toolbar items should just be a way to do what
     //is also in a menu.
 
-    m_Toolbar.set_toolbar_style(Gtk::ToolbarStyle::BOTH);
-
-    auto item = Gtk::make_managed<Gtk::ToolButton>("Click me");
-    //item.set_tooltips(*tooltips, "Toolbar item");
-    m_Toolbar.append(*item);
+    auto item = Gtk::make_managed<Gtk::Button>("Click me");
+    item->set_tooltip_text("Toolbar item");
+    m_Toolbar.add(*item);
     item->signal_clicked().connect( sigc::mem_fun(*this,
                 &ExampleWindow::on_toolbar_item) );
 
-    m_Toolbar.append(*Gtk::make_managed<Gtk::SeparatorToolItem>());
+    m_Toolbar.add(*Gtk::make_managed<Gtk::Separator>());
 
-    item = Gtk::make_managed<Gtk::ToolButton>("_Save");
+    item = Gtk::make_managed<Gtk::Button>("_Save");
     item->set_use_underline();
+    item->set_tooltip_text("Save");
     item->set_icon_name("document-save");
-    item->set_homogeneous(false);
-    m_Toolbar.append(*item);
+    m_Toolbar.add(*item);
     item->signal_clicked().connect( sigc::mem_fun(*this,
                 &ExampleWindow::on_toolbar_item) );
 
-    item = Gtk::make_managed<Gtk::ToggleToolButton>("Toggle me");
-    //item.set_tooltips(*tooltips, "toggle duh");
-    m_Toolbar.append(*item);
+    item = Gtk::make_managed<Gtk::ToggleButton>("Toggle me");
+    item->set_tooltip_text("toggle duh");
+    m_Toolbar.add(*item);
     item->signal_clicked().connect( sigc::mem_fun(*this,
                 &ExampleWindow::on_toolbar_item) );
 
     Gtk::RadioButtonGroup group;
-    m_Toolbar.append(*Gtk::make_managed<Gtk::RadioToolButton>(group, "Radio 1"));
-    m_Toolbar.append(*Gtk::make_managed<Gtk::RadioToolButton>(group, "Radio 2"));
-    m_Toolbar.append(*Gtk::make_managed<Gtk::RadioToolButton>(group, "Radio 3"));
+    m_Toolbar.add(*Gtk::make_managed<Gtk::RadioButton>(group, "Radio 1"));
+    m_Toolbar.add(*Gtk::make_managed<Gtk::RadioButton>(group, "Radio 2"));
+    m_Toolbar.add(*Gtk::make_managed<Gtk::RadioButton>(group, "Radio 3"));
   }
 }
 
diff --git a/examples/book/toolbar/examplewindow.h b/examples/book/toolbar/examplewindow.h
index be1eba9..21ec17e 100644
--- a/examples/book/toolbar/examplewindow.h
+++ b/examples/book/toolbar/examplewindow.h
@@ -33,7 +33,7 @@ protected:
   //Child widgets:
   Gtk::Box m_VBox;
   Gtk::Box m_ButtonBox;
-  Gtk::Toolbar m_Toolbar;
+  Gtk::Box m_Toolbar;
   Gtk::Button m_Button_Close;
 };
 
diff --git a/examples/book/update_ui/examplewindow.cc b/examples/book/update_ui/examplewindow.cc
index 55dafad..3a7b3e5 100644
--- a/examples/book/update_ui/examplewindow.cc
+++ b/examples/book/update_ui/examplewindow.cc
@@ -28,6 +28,7 @@ ExampleWindow::ExampleWindow()
   m_VBox.set_margin(6);
   add(m_VBox);
 
+  m_ProgressBar.set_show_text(true);
   m_VBox.add(m_ProgressBar);
   m_VBox.add(m_ButtonBox);
 
@@ -53,20 +54,20 @@ void ExampleWindow::on_button_quit()
 
 void ExampleWindow::on_button_start()
 {
-  const double max = 10000;
-  //Do intensive work, while still keeping the user interface updated and
-  //responsive.
+  const double max = 20000;
+  // Do intensive work, while still keeping the user interface updated and responsive.
+  // An alternative would be to do the intensive work in a separate thread.
   for(double i = 0; i < max; ++i)
   {
-     std::cout << "gtkmm example: example output: " << i << " of "
-         << max << std::endl;
+    std::cout << "gtkmm example: example output: " << i << " of "
+      << max << std::endl;
 
-     m_ProgressBar.set_fraction(i / max);
+    m_ProgressBar.set_fraction(i / max);
 
-     // Allow GTK+ to perform all updates for us. Without this, the progress bar
-     // will appear to do nothing and then suddenly fill completely.
-     while(Gtk::Main::events_pending())
-         Gtk::Main::iteration();
+    // Allow GTK+ to perform all updates for us. Without this, the progress bar
+    // will appear to do nothing and then suddenly fill completely.
+    auto main_context = Glib::MainContext::get_default();
+    while (main_context->pending())
+      main_context->iteration(true);
   }
 }
-
diff --git a/examples/others/calendar/calendar.cc b/examples/others/calendar/calendar.cc
index b46d9d9..f67e085 100644
--- a/examples/others/calendar/calendar.cc
+++ b/examples/others/calendar/calendar.cc
@@ -43,8 +43,9 @@ protected:
   void on_button_close();
   void on_parsing_error(const Glib::RefPtr<const Gtk::CssSection>& section, const Glib::Error& error);
 
-  Gtk::CheckButton* flag_checkboxes_[5];
-  bool settings_[5];
+  static const int n_checkboxes = 3;
+  Gtk::CheckButton* flag_checkboxes_[n_checkboxes];
+  bool settings_[n_checkboxes];
 
   Glib::RefPtr<Gtk::CssProvider> css_provider_;
 
@@ -54,12 +55,12 @@ protected:
   Gtk::Label* label_selected_double_click_;
   Gtk::Label* label_month_;
 
-  Glib::Date get_date() const;
+  Glib::DateTime get_date() const;
 };
 
 CalendarExample::~CalendarExample()
 {
-  for (int i = 0; i < 5; i++)
+  for (int i = 0; i < n_checkboxes; i++)
   {
          delete flag_checkboxes_[i];
   }
@@ -76,39 +77,33 @@ CalendarExample::~CalendarExample()
 
 void CalendarExample::month_changed()
 {
-  label_month_->set_text(get_date().format_string("%x"));
+  label_month_->set_text(get_date().format("%x"));
 }
 
 void CalendarExample::day_selected()
 {
-  label_selected_->set_text(get_date().format_string("%x"));
+  label_selected_->set_text(get_date().format("%x"));
 }
 
 void CalendarExample::day_selected_double_click()
 {
-  label_selected_double_click_->set_text(get_date().format_string("%x"));
+  label_selected_double_click_->set_text(get_date().format("%x"));
 }
 
 void CalendarExample::set_flags()
 {
-  int options = 0;
-
-  for (int i = 0; i < 5; i++)
+  if (calendar_)
   {
-    if (settings_[i])
-    {
-      options = options + (1 << i);
-    }
+    calendar_->set_show_heading(settings_[0]);
+    calendar_->set_show_day_names(settings_[1]);
+    calendar_->set_show_week_numbers(settings_[2]);
   }
-
-  if (calendar_)
-    calendar_->set_display_options((Gtk::Calendar::DisplayOptions)options);
 }
 
 void CalendarExample::toggle_flag(Gtk::CheckButton *toggle)
 {
   int j = 0;
-  for (int i = 0; i < 5; i++)
+  for (int i = 0; i < n_checkboxes; i++)
     if (flag_checkboxes_[i] == (Gtk::CheckButton *)toggle)
       j = i;
 
@@ -158,7 +153,7 @@ void CalendarExample::on_parsing_error(const Glib::RefPtr<const Gtk::CssSection>
 
 CalendarExample::CalendarExample()
 {
-  for (int i = 0; i < 5; i++) {
+  for (int i = 0; i < n_checkboxes; i++) {
     settings_[i] = 0;
   }
 
@@ -190,9 +185,10 @@ CalendarExample::CalendarExample()
   set_flags();
   calendar_->mark_day(19);
   frame->add(*calendar_);
-  calendar_->signal_month_changed().connect(sigc::mem_fun(*this, &CalendarExample::month_changed));
+  calendar_->signal_prev_month().connect(sigc::mem_fun(*this, &CalendarExample::month_changed));
+  calendar_->signal_next_month().connect(sigc::mem_fun(*this, &CalendarExample::month_changed));
   calendar_->signal_day_selected().connect(sigc::mem_fun(*this, &CalendarExample::day_selected));
-  calendar_->signal_day_selected_double_click().connect(sigc::mem_fun(*this, 
&CalendarExample::day_selected_double_click));
+  //calendar_->signal_day_selected_double_click().connect(sigc::mem_fun(*this, 
&CalendarExample::day_selected_double_click));
 
   auto separator = Gtk::make_managed<Gtk::Separator>(Gtk::Orientation::VERTICAL);
   hbox->add(*separator);
@@ -211,17 +207,15 @@ CalendarExample::CalendarExample()
   frameFlags->add(*vbox3);
 
   struct {
-    const char *label;
-  } flags[] =
+    const char* label;
+  } flags[n_checkboxes] =
     {
       { "Show Heading" },
       { "Show Day Names" },
-      { "No Month Change" },
       { "Show Week Numbers" },
-      { "Week Start Monday" }
     };
 
-  for (int i = 0; i < 5; i++)
+  for (int i = 0; i < n_checkboxes; i++)
   {
     auto toggle = new Gtk::CheckButton(flags[i].label);
     toggle->signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &CalendarExample::toggle_flag), 
toggle));
@@ -286,13 +280,9 @@ CalendarExample::CalendarExample()
   set_default_widget(*button);
 }
 
-Glib::Date CalendarExample::get_date() const
+Glib::DateTime CalendarExample::get_date() const
 {
-  using Glib::Date;
-  Date date;
-  calendar_->get_date(date);
-
-  return date;
+  return calendar_->get_date();
 }
 
 int main(int argc, char** argv)
diff --git a/meson.build b/meson.build
index 9cf1de2..48b69a7 100644
--- a/meson.build
+++ b/meson.build
@@ -17,7 +17,7 @@ if not python_version.version_compare(python_version_req)
 endif
 
 gtkmm_pcname = 'gtkmm-4.0'
-gtkmm_dep = dependency(gtkmm_pcname, version: '>=3.95.1')
+gtkmm_dep = dependency(gtkmm_pcname, version: '>=3.97.1')
 giomm_dep = dependency('giomm-2.64', version: '>=2.63.1')
 gnome = import('gnome')
 


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