
Question:
In glade it is possible to set an unique ID to an object. In the code one can obtain a pointer to this object by searching for it's "glade ID" via <a href="https://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder-get-object" rel="nofollow">gtk_builder_get_object()
</a>.
However for my current use-case I just want to read out this ID from an <a href="https://stackoverflow.com/questions/38254924/find-glade-gtk3-widget-by-unique-id/38287535#38287535" rel="nofollow">GObject
</a>. What's the API to do so ?
You can't. The builder ID is stored in the builder internally, not in the GObject.
The reason for this is that IDs must be unique per builder, which would be impossible to enforce if you were able to get and set them via some GObject API.
Answer2:You could use <a href="https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-get-name" rel="nofollow">gtk_widget_get_name()</a> to identify an object.