0

I'm using PyGObject with GTK 3.22.25. I've built a UI in Glade and am loading it using Gtk.Builder. My UI includes a Gtk.TreeView with Gtk.TreeViewColumn children, each with a Gtk.CellRendererText renderer. One of these is called 'inventory_stock_cell'.

I can look up the cell renderers on the Builder object with eg. builder.get_object('inventory_stock_cell') but if I try to iterate over the objects in the builder with builder.get_objects() the cell renderers are not included in the objects returned.

Am I doing something wrong? Is this deliberate? A bug?

Tom
  • 7,269
  • 1
  • 42
  • 69
  • This looks unlikely to happen based on the GtkBuilder implementation -- get_objects() seems to return every item that get_object() could ever return... Can you share a test case? – Jussi Kukkonen Feb 04 '18 at 16:58
  • As often, constructing a test case has shown where I went wrong. The problem is that `Gtk.CellRenderer` doesn't implement `Gtk.Buildable` and so doesn't have a `get_name` function. This was causing an exception, which I was ignoring. – Tom Feb 04 '18 at 17:33
  • On a subsequent point, if I assign a name to a cell renderer, by setting the 'ID' setting in Glade, is there any way to find out what that name is in Python? – Tom Feb 04 '18 at 17:37
  • Or am I supposed to set widget name and then use `obj.get_property('name')`? – Tom Feb 04 '18 at 17:37

0 Answers0