[gtkmm-documentation] Update some buildapp examples



commit c584f04eccce155fe47ab5fc44670fbd464c5572
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Fri Feb 7 16:43:41 2020 +0100

    Update some buildapp examples
    
    Use Gtk::IconTheme::get_for_display() instead of the removed get_default().
    Don't use the removed use-popover property in window.ui.

 examples/book/buildapp/step7/window.ui                  | 1 -
 examples/book/buildapp/step8/window.ui                  | 1 -
 examples/book/buildapp/step9/exampleappwindow.cc        | 2 +-
 examples/book/buildapp/step9/window.ui                  | 1 -
 examples/others/cellrenderercustom/cellrendererpopup.cc | 7 +++++--
 5 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/examples/book/buildapp/step7/window.ui b/examples/book/buildapp/step7/window.ui
index 7ad2e28..188b84f 100644
--- a/examples/book/buildapp/step7/window.ui
+++ b/examples/book/buildapp/step7/window.ui
@@ -23,7 +23,6 @@
             <child type="end">
               <object class="GtkMenuButton" id="gears">
                 <property name="direction">none</property>
-                <property name="use-popover">True</property>
                 <style>
                   <class name="image-button"/>
                 </style>
diff --git a/examples/book/buildapp/step8/window.ui b/examples/book/buildapp/step8/window.ui
index 3a0b1fc..677bed8 100644
--- a/examples/book/buildapp/step8/window.ui
+++ b/examples/book/buildapp/step8/window.ui
@@ -34,7 +34,6 @@
             <child type="end">
               <object class="GtkMenuButton" id="gears">
                 <property name="direction">none</property>
-                <property name="use-popover">True</property>
                 <style>
                   <class name="image-button"/>
                 </style>
diff --git a/examples/book/buildapp/step9/exampleappwindow.cc 
b/examples/book/buildapp/step9/exampleappwindow.cc
index 1d4d62d..584132c 100644
--- a/examples/book/buildapp/step9/exampleappwindow.cc
+++ b/examples/book/buildapp/step9/exampleappwindow.cc
@@ -113,7 +113,7 @@ ExampleAppWindow::ExampleAppWindow(BaseObjectType* cobject,
   set_show_menubar(true);
 
   // Set the window icon.
-  Gtk::IconTheme::get_default()->add_resource_path("/org/gtkmm/exampleapp");
+  Gtk::IconTheme::get_for_display(get_display())->add_resource_path("/org/gtkmm/exampleapp");
   set_icon_name("exampleapp");
 }
 
diff --git a/examples/book/buildapp/step9/window.ui b/examples/book/buildapp/step9/window.ui
index 83baf4a..9626660 100644
--- a/examples/book/buildapp/step9/window.ui
+++ b/examples/book/buildapp/step9/window.ui
@@ -33,7 +33,6 @@
         <child type="end">
           <object class="GtkMenuButton" id="gears">
             <property name="direction">none</property>
-            <property name="use-popover">True</property>
             <style>
               <class name="image-button"/>
             </style>
diff --git a/examples/others/cellrenderercustom/cellrendererpopup.cc 
b/examples/others/cellrenderercustom/cellrendererpopup.cc
index b977a60..40baf0d 100644
--- a/examples/others/cellrenderercustom/cellrendererpopup.cc
+++ b/examples/others/cellrenderercustom/cellrendererpopup.cc
@@ -67,7 +67,10 @@ CellRendererPopup::CellRendererPopup()
     sigc::mem_fun(*this, &Self::on_popup_window_key_pressed), true);
   popup_window_.add_controller(controller);
 
-  popup_window_.signal_style_updated().connect(sigc::mem_fun(*this, &Self::on_style_updated));
+  // GtkWidget::style-updated has been replaced with the css_changed vfunc,
+  // which can't be wrapped in gtkmm. It has a GtkCssStyleChange parameter.
+  // GtkCssStyleChange is private in gtk.
+  //popup_window_.signal_style_updated().connect(sigc::mem_fun(*this, &Self::on_style_updated));
 }
 
 CellRendererPopup::~CellRendererPopup()
@@ -176,7 +179,7 @@ void CellRendererPopup::on_show_popup(const Glib::ustring&, int, int y1, int x2,
   const int button_height = y2 - y1;
 
   auto display = Gdk::Display::get_default();
-  auto monitor = display->get_primary_monitor();
+  auto monitor = display->get_monitor(0);
   Gdk::Rectangle workarea;
   monitor->get_workarea(workarea);
   int monitor_height = workarea.get_height() - y;


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