Does GTK always return same pointer for same widget?

I have some GtkTreeViewColumns defined in a UI file. I extract them like this:

GtkTreeViewColumn *name_column;
name_column = GTK_TREE_VIEW_COLUMN (gtk_builder_get_object (builder, "name-column"));

Later, I get a GtkTreeViewColumn from somewhere else in GTK, for example:

GtkTreeViewColumn *column;
gtk_tree_view_get_path_at_pos (tree_view, x, y, NULL, &column, NULL, NULL);

I want to know whether column is the name_column or some other. Is it sufficient to check column == name_column? In other words, will GTK always represent a given widget with the same GObject *?

(This must be the basics of GTK; if I’m missing some required reading, please point me to the docs where this is spelled out.)

Yes, an object is always equal to itself - assuming it’s actually the same object (i.e. literally the same, not just representing the same data)

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