How to iterate all children with up to down order in GTK3?

I have a GtkListbox widget with some rows like this:
image

BTW: rows inserted as order as red number show.

I want to iterate all children with up to down order(1,2,3,5,6,7,4), but failed to done this, the methods: foreach and get_children are arranged as order as red number show(1,2,3,4,5,6,7)

How to iterate all children from up to down order?

From the API docs I would assume that

GtkListBox: GTK+ 3 Reference Manual

may do the trick. That function should be available in Vala too.

I wonder why you are still using GTK3 – has Vala not good GTK4 support or is GTK4 not available in your country?

get_row_at_index is a good choice, but I don’t know the order exactly at runtime.

Port to GTK4 is on the next major version plan list, because GTK4 on windows(4.3.1) yet not get prefect.

Then I would try to add to each row an id number and try to manually sort the entries. Unfortunately I have not yet learned to use GtkListBox myself, so I can not really help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.