How to create an empty row in GTKTreeView?
Question: How can I create an empty row (2 floats) in GTKTreeView? I set up this:

    
    
        self.liststore = Gtk.ListStore(float, float)
        self.treeview = Gtk.TreeView(model=self.liststore)
    

and then add 3 rows:

    
    
        self.liststore.append([2.35, 2.40])
        self.liststore.append([3.45, 4.70])
        self.liststore.append()
    

but the 3rd row is filled with 0.00000 each when I execute the program. How
can I create a true empty row? Or how can I display an empty row in
GtkTreeView?

![enter image description here](http://i.stack.imgur.com/6LyjT.png)

I am working on a program that plots points and adds a new row each time the
empty row is filled:

    
    
        #!/usr/bin/python3
    
        from gi.repository import Gtk
        from matplotlib.figure import Figure
        from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCanvas
    
        class DataBase():
            def __init__(self):
                self.window = Gtk.Window()
                self.window.set_default_size(800, 500)
                self.box = Gtk.Box()
                self.window.add(self.box)
    
                self.fig = Figure(figsize=(10,10), dpi=80)
                self.ax = self.fig.add_subplot(111)
    
                self.canvas = FigureCanvas(self.fig)
                self.box.pack_start(self.canvas, True, True, 0)
    
                self.liststore = Gtk.ListStore(float, float)
                self.treeview = Gtk.TreeView(model=self.liststore)
                self.box.pack_start(self.treeview, False, True, 0)
    
                self.xrenderer = Gtk.CellRendererText()
                self.xrenderer.set_property("editable", True)
                self.column_text = Gtk.TreeViewColumn("x-Value", self.xrenderer, text=0)
                self.treeview.append_column(self.column_text)
    
                self.yrenderer = Gtk.CellRendererText()
                self.yrenderer.set_property("editable", True)
                self.column_editabletext = Gtk.TreeViewColumn("y-Value", self.yrenderer, text=1)
                self.treeview.append_column(self.column_editabletext)
    
                self.xrenderer.connect("edited", self.xedited)
                self.yrenderer.connect("edited", self.yedited)
    
                self.liststore.append([2.35, 2.40])
                self.liststore.append([3.45, 4.70])
                self.liststore.append()
    
            def resetplot(self):
                self.ax.cla()
                self.ax.set_xlim(0,10)
                self.ax.set_ylim(0,10)
                self.ax.grid(True)
    
            def plotpoints(self):
                self.resetplot()
                for row in self.liststore:
                    self.ax.scatter(row[:1], row[1:], marker='o', s=50)
                self.fig.canvas.draw()
    
            def xedited(self, widget, path, number):
                self.liststore[path][0] = float(number.replace(',', '.'))
                self.plotpoints()
    
            def yedited(self, widget, path, number):
                self.liststore[path][1] = float(number.replace(',', '.'))
                self.plotpoints()
    
        db = DataBase()
        db.resetplot()
        db.plotpoints()
    
        db.window.connect("delete-event", Gtk.main_quit)
        db.window.show_all()
        Gtk.main()
    


Answer: I don't think you can, just don't add a row unless you've got data for it,
unless you store strings in the model. Then you can have empty strings for the
empty rows.

