On 26-06-18 14:54, Russel Winder wrote:

By checking addresses, it would appear that:

if (mainBox.getChildren().first().data() is label.getLabelStruct()) {

does the right thing. But I am worried I am missing something about what is actually being tested here.

getChildren return a linked list, the data property of the elements will
hold a reference to the child widget.

getLabelStruct returns the reference GtkD holds on the widget.

Both whould be a GtkLabel* in this case.