[gnome-maps/wip/mlundblad/remove-more-gtk-widget-destroy: 4/6] socialPlaceListBox: Stop using gtk_widget_destroy()




commit e78705290f0fbd0415a1c00663ecfcac30f21ede
Author: Marcus Lundblad <ml update uu se>
Date:   Fri Apr 23 23:42:32 2021 +0200

    socialPlaceListBox: Stop using gtk_widget_destroy()
    
    destroy() will only work for top-levels in GTK 4.
    Prepare by using container-specific methods to
    remove children.

 src/socialPlaceListBox.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/socialPlaceListBox.js b/src/socialPlaceListBox.js
index 7f756393..d12d9197 100644
--- a/src/socialPlaceListBox.js
+++ b/src/socialPlaceListBox.js
@@ -71,9 +71,12 @@ var SocialPlaceListBox = GObject.registerClass({
     }
 
     set matches(matches) {
-        this.forall(function(row) {
-            row.destroy();
-        });
+        let row = this.get_row_at_index(0);
+
+        while (row) {
+            this.remove(row);
+            row = this.get_row_at_index(0);
+        }
 
         this._matches = matches;
 


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