Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make some mini CRM application in python using gtk(pygtk), glade and started to develop it using quickly(which is awesome).

I'm created some dialogs and added listview to the GUI using glade) but when I try to add some items to the list dynamically, from the script that glade\quickly created so the application will show some data to the user that called from MySql (if there is another option ill be glad to here about..) it show alot of errors instead (in the terminal).

I looked for some tutorials but all I found is only tuts that explain how to create the list from scratch (not using quickly, and glade).

Here is the code:

This is the that created by quickly

I added basic code for buttons dialogs and so...

import gettext
from gettext import gettext as _

from gi.repository import Gtk # pylint: disable=E0611
import logging
logger = logging.getLogger('ubuntucrm')

from ubuntucrm_lib import Window
from ubuntucrm.AboutUbuntucrmDialog import AboutUbuntucrmDialog
from ubuntucrm.PreferencesUbuntucrmDialog import PreferencesUbuntucrmDialog
from ubuntucrm.PopupcalendarDialog import PopupcalendarDialog
from ubuntucrm.NewcustomerDialog import NewcustomerDialog
from ubuntucrm.GlobalsearchDialog import GlobalsearchDialog

# See for more details about how this class works
class UbuntucrmWindow(Window):
    __gtype_name__ = "UbuntucrmWindow"

def finish_initializing(self, builder): # pylint: disable=E1002
    """Set up the main window"""
    super(UbuntucrmWindow, self).finish_initializing(builder)

    self.AboutDialog = AboutUbuntucrmDialog
    self.PreferencesDialog = PreferencesUbuntucrmDialog
    #self.PopupcalendarDialog = PopupcalendarDialog

    # Code for other initialization actions should be added here.

    self.CalendarButton = self.builder.get_object("CalendarButton")
    self.contactsButton = self.builder.get_object("contactsButton")
    self.productsButton = self.builder.get_object("productsButton")
    self.OtherButton    = self.builder.get_object("OtherButton")

    #dialogs = PopupcalendarDialog()
    self.contactsDialog = NewcustomerDialog()
    self.globalsearcher = GlobalsearchDialog()

    #lists and modelers
    self.leftTree    = self.builder.get_object("leftTreeview")
    self.treeModeler = self.builder.get_object("liststorer1")

def on_OtherButton_clicked(self, widget):
    print "you clicked OtherButton"

//here i tried somthing like:

    self.treeModeler.append(["bla bla","some text"])

//for example, "bla bla" loaded from some MySQL Database..

def on_productsButton_clicked(self, widget):
    print "you clicked producs button"

def on_contactsButton_clicked(self, widget):
    print "you clicked contactButton "

def on_CalendarButton_clicked(self, widget):
    print "calling to calendar button"

The error is:

 (ubuntucrm:10443): Gtk-CRITICAL **: gtk_list_store_get_value: assertion `column < priv->n_columns' failed

and the order is incorrect

|some text | bla bla |

instead of:

| bla bla | some text |

share|improve this question
up vote 0 down vote accepted

Always provide the full traceback and additional warnings/output. That said, your problem is in the following line of code:

    self.treeModeler.append("bla bla")

You should provide a list of items that corresponds to the columns in the Gtk.TreeModel. So if your model only has 1 string column, simple put some brackets around your string:

    self.treeModeler.append(["bla bla"])

Do you have more columns with different types? Provide them in your list:

    self.treeModeler.append(["bla bla", 1234, False, 1.234, GdkPixbuf.Pixbuf, None])

Edit to your edit: Remember that you add values to the Gtk.TreeModel columns, not Gtk.TreeView columns. See my screenshots in this answer and make sure you mapped each Gtk.TreeModel column to the correct Gtk.CellRendererText.

share|improve this answer

I got this error when I had the GtkCellRendererText text attribute set to a zero-based index on a column that did not exist.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.