GtkContainer get_child_property advice

I have the following code snippet to get a list of index numbers and child widgets (in this example for a GtkGrid and placed into a hashref)

It works but seems inelegant, is there a better way?