[gnome-maps/wip/mlundblad/fix-gtk-deprecations-placeview] placeView: Stop using GtkContainer add and remove




commit 2522ceb13f9398e6b592bc110c016a87bb11fbfa
Author: Marcus Lundblad <ml update uu se>
Date:   Mon Apr 5 13:06:50 2021 +0200

    placeView: Stop using GtkContainer add and remove
    
    In preparation for GTK 4 use class-specific methods
    to add and remove children when possible.

 src/placeView.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/placeView.js b/src/placeView.js
index 4bb266df..fff3f6a8 100644
--- a/src/placeView.js
+++ b/src/placeView.js
@@ -130,7 +130,7 @@ var PlaceView = GObject.registerClass({
 
         this._placeDetails = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
                                            visible: true});
-        this.content.add(this._placeDetails);
+        this.content.attach(this._placeDetails, 0, 0, 1, 1);
 
         if (this.place.isCurrentLocation) {
             this._populate(this.place);
@@ -583,7 +583,7 @@ var PlaceView = GObject.registerClass({
 
     // clear the view widgets to be able to re-populate an updated place
     _clearView() {
-        this._placeDetails.get_children().forEach((child) => child.destroy());
+        this._placeDetails.get_children().forEach((child) => this._placeDetails.remove(child));
     }
 
     // called when the place's location changes (e.g. for the current location)


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