Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I read out the "glade ID" of a gtk3 object

Tags:

glade

gtk3

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 gtk_builder_get_object().

However for my current use-case I just want to read out this ID from an GObject. What's the API to do so ?

like image 729
Alex Avatar asked Mar 12 '23 12:03

Alex


1 Answers

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.

like image 148
ptomato Avatar answered Apr 29 '23 19:04

ptomato