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 gladequickly 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 applicationWindow.py that created by quickly
I added basic code for buttons dialogs and so...
import gettext
from gettext import gettext as _
gettext.textdomain('ubuntucrm')
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 ubuntucrm_lib.Window.py 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
self.cal = PopupcalendarDialog()
self.contactsDialog = NewcustomerDialog()
self.globalsearcher = GlobalsearchDialog()
#lists and modelers
self.leftTree = self.builder.get_object("leftTreeview")
self.treeModeler = self.builder.get_object("liststorer1")
#functions
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"
self.globalsearcher.run()
def on_contactsButton_clicked(self, widget):
print "you clicked contactButton "
self.contactsDialog.run()
def on_CalendarButton_clicked(self, widget):
print "calling to calendar button"
self.cal.run()
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 |