* src/SourceView.py: handle column sorting properly

* src/PlaceView.py: handle column sorting properly


svn: r2740
This commit is contained in:
Don Allingham 2004-02-01 04:49:49 +00:00
parent ef4419b8a0
commit 6080ab594e
2 changed files with 14 additions and 0 deletions

View File

@ -83,8 +83,11 @@ class PlaceView:
column.set_visible(gtk.TRUE)
column.set_sort_column_id(title[1])
column.set_min_width(title[2])
column.connect('clicked',self.on_click)
self.list.append_column(column)
self.click_col = None
self.model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING, gobject.TYPE_STRING,
@ -97,6 +100,9 @@ class PlaceView:
self.list.connect('button-press-event',self.button_press)
self.topWindow = self.glade.get_widget("gramps")
def on_click(self,column):
self.click_col = column
def change_db(self,db):
self.db = db
@ -127,6 +133,8 @@ class PlaceView:
12, val[12]
)
self.list.set_model(self.model)
if self.click_col:
self.click_col.clicked()
def goto(self,id):
self.selection.unselect_all()

View File

@ -83,14 +83,20 @@ class SourceView:
column.set_visible(gtk.TRUE)
column.set_sort_column_id(title[1])
column.set_min_width(title[2])
column.connect('clicked',self.on_click)
self.list.append_column(column)
self.click_col = None
self.model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING)
self.list.set_model(self.model)
self.topWindow = self.glade.get_widget("gramps")
def on_click(self,column):
self.click_col = column
def change_db(self,db):
self.db = db