[gnome-maps/wip/mlundblad/cleanup-gtk-deprecations: 7/8] socialPlaceListBox: Stop using GtkContainer add methods




commit c5f202378a426e41956a2cbdbeefd66468f2bbb3
Author: Marcus Lundblad <ml update uu se>
Date:   Fri Mar 26 22:09:19 2021 +0100

    socialPlaceListBox: Stop using GtkContainer add methods
    
    In preparation for GTK 4 use class-specific methods
    to add and remove children when possible.
    Also stop using gtk_widget_destroy() to remove
    rows, instead use .remove() on the list itself.

 src/socialPlaceListBox.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/socialPlaceListBox.js b/src/socialPlaceListBox.js
index cb70fec7..7f756393 100644
--- a/src/socialPlaceListBox.js
+++ b/src/socialPlaceListBox.js
@@ -59,7 +59,7 @@ var SocialPlaceListBox = GObject.registerClass({
         this.connect('row-activated', (list, row) => {
             if (!row.place) {
                 // "Show more results" row activated
-                row.destroy();
+                this.remove(row);
                 this._showBadMatches();
             } else
                 this.emit('place-selected', row.place);
@@ -94,10 +94,10 @@ var SocialPlaceListBox = GObject.registerClass({
     }
 
     _addPlace(place) {
-        this.add(new SocialPlaceRow({ place: place }));
+        this.insert(new SocialPlaceRow({ place: place }), -1);
     }
 
     _addMoreResults() {
-        this.add(new SocialPlaceMoreResultsRow({}));
+        this.insert(new SocialPlaceMoreResultsRow({}), -1);
     }
 });


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