Skip to content

Commit 92ddd6b

Browse files
committed
Replace use of gtk_list_box_remove_all to support pre Gtk 4.12
1 parent 6367410 commit 92ddd6b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Sources/Gtk/Widgets/ListBox+ManualAdditions.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ extension ListBox {
66
}
77

88
public func removeAll() {
9-
var index = 0
10-
while let row = gtk_list_box_get_row_at_index(opaquePointer, gint(index)) {
9+
while let row = gtk_list_box_get_row_at_index(opaquePointer, 0) {
1110
gtk_list_box_row_set_child(row, nil)
12-
index += 1
11+
gtk_list_box_remove(opaquePointer, row.cast())
1312
}
14-
gtk_list_box_remove_all(opaquePointer)
1513
}
1614

1715
/// Returns `true` on success.

0 commit comments

Comments
 (0)