you're creating the GtkGrid with homogeneous spacing for columns and rows; this means that your columns and rows will receive the same size, which is the maximum natural size between all the columns and rows.
when creating the Grid, remove the row_homogeneous=True
attribute. if you want the TreeView to expand, you should set the hexpand
and vexpand
properties to True
on it, i.e.:
# creamos una grilla
self.grid = Gtk.Grid(column_homogeneous=True,
column_spacing=10,
row_spacing=10)
[...]
# creamos el TreeView
self.treeview = Gtk.TreeView(model=self.liststore)
# set the TreeView to expand both horizontally and vertically
self.treeview.set_hexpand(True)
self.treeview.set_vexpand(True)
GtkGrid is a container and layout manager that respects the horizontal and vertical expansion and alignment flags on the GtkWidget, instead of having packing properties, like GtkBox or GtkTable.