Reputation: 149
As heading says: a small seemingly ok snippet generates 3 warnings:
Gtk-WARNING **: Refusing to add the same cell renderer to a GtkCellAreaBox twice
The code:
from gi.repository import Gtk
renderers = {}
for ix, col in enumerate(['vendor', 'conf', 'supports']):
renderers[col] = Gtk.CellRendererText()
column = Gtk.TreeViewColumn(col, renderers[col], text=ix)
column.pack_start(renderers[col], True)
It seems to work anyway in it's natural context, but I'm not really happy with these warnings... tested with both python2 and python3, no difference (as expected)
Gtk version: gtk3-3.10.6-1.fc20.i686
Any hint out there?
--alec
Upvotes: 0
Views: 212
Reputation: 1195
Just use 1 Gtk.CellRenderer, unless you want specific property to be added on different renderers.
On the matter of the warning, the doc said (if i remember correctly), instantiate Gtk.TreeViewColumn (*args) is equal with :
So, the warning is actually correct, you did pack the renderer twice, by invoke "pack" method again. Just remove the Gtk.TreeViewColumn.pack_start/end method.
Upvotes: 1