remember separator position when refresh is clicked

This commit is contained in:
sqlcoder 2010-03-08 22:47:44 +00:00
parent 04acf25416
commit 6117eb64c8

View File

@ -142,7 +142,7 @@ class GuiPlayerStats (threading.Thread):
self.stats_frame = gtk.Frame() self.stats_frame = gtk.Frame()
self.stats_frame.show() self.stats_frame.show()
self.stats_vbox = gtk.VBox(False, 0) self.stats_vbox = gtk.VPaned()
self.stats_vbox.show() self.stats_vbox.show()
self.stats_frame.add(self.stats_vbox) self.stats_frame.add(self.stats_vbox)
# self.fillStatsFrame(self.stats_vbox) # self.fillStatsFrame(self.stats_vbox)
@ -155,12 +155,15 @@ class GuiPlayerStats (threading.Thread):
# make sure Hand column is not displayed # make sure Hand column is not displayed
[x for x in self.columns if x[0] == 'hand'][0][1] = False [x for x in self.columns if x[0] == 'hand'][0][1] = False
self.last_pos = -1
def get_vbox(self): def get_vbox(self):
"""returns the vbox of this thread""" """returns the vbox of this thread"""
return self.main_hbox return self.main_hbox
def refreshStats(self, widget, data): def refreshStats(self, widget, data):
self.last_pos = self.stats_vbox.get_position()
try: self.stats_vbox.destroy() try: self.stats_vbox.destroy()
except AttributeError: pass except AttributeError: pass
self.liststore = [] self.liststore = []
@ -170,6 +173,8 @@ class GuiPlayerStats (threading.Thread):
self.stats_vbox.show() self.stats_vbox.show()
self.stats_frame.add(self.stats_vbox) self.stats_frame.add(self.stats_vbox)
self.fillStatsFrame(self.stats_vbox) self.fillStatsFrame(self.stats_vbox)
if self.last_pos > 0:
self.stats_vbox.set_position(self.last_pos)
def fillStatsFrame(self, vbox): def fillStatsFrame(self, vbox):
sites = self.filters.getSites() sites = self.filters.getSites()