Hi John,
Thanks for reply my question.
I have already tried the first two methods, but didn't work. The third, I have been reading about how to create my own model, but I didn't try it yet.Some things you can do to improve performance:
* set_fixed_height_mode * use fixed with columns in the view * use your own custom tree_model.
Finally, I'm not entirely sure whether your performance issues are a variation on what I am running into. Can you post a simple code snippet?
Here is a bit of the code: # Creating the Treeview # self.liststore = gtk.ListStore(str,str)
#sequence treeview => _This is the slow Treeview_
self._seqs_treeview.set_model(self.liststore)
seqsselection = self._seqs_treeview.get_selection()
seqsselection.set_mode(gtk.SELECTION_MULTIPLE) #spp treeview
self._spp_treeview.set_model(self.liststore)#After opened the desired file and selected the desired rows to color, the color data is loaded into the Treeview#
(model, paths) = sppselection.get_selected_rows()
tmpliststore = {}
names = []
uncolored = {}
for path in paths:
kiter = model.get_iter(path)
name = model.get_value(kiter,0)
sequncolor = model.get_value(kiter,1)
seq2 =[]
names.append(name)
for letter in sequncolor:#THIS STEP turn my treeview too slow
if letter == "A" :
seq2.append('<span background="blue">A</span>')
elif letter == "T":
seq2.append('<span background="red">T</span>')
elif letter == "C":
seq2.append('<span background="yellow">C</span>')
elif letter == "G":
seq2.append('<span background="green">G</span>')
elif letter == "R":
seq2.append('<span background="brown">R</span>')
elif letter == "M":
seq2.append('<span background="violet">M</span>')
elif letter == "S":
seq2.append('<span background="darkblue">S</span>')
elif letter == "N":
seq2.append('<span background="darkred">N</span>')
elif letter == "D":
seq2.append('<span background="darkgreen">D</span>')
elif letter == "E":
seq2.append('<span background="yellowgreen">E</span>')
elif letter == "K":
seq2.append('<span background="wheat">K</span>')
elif letter == "V":
seq2.append('<span background="turquoise">V</span>')
elif letter == "I":
seq2.append('<span background="darkviolet">I</span>')
elif letter == "P":
seq2.append('<span background="gold">P</span>')
elif letter == "L":
seq2.append('<span background="greenyellow">L</span>')
elif letter == "H":
seq2.append('<span background="khaki">H</span>')
elif letter == "Y":
seq2.append('<span background="pink">Y</span>')
elif letter == "Q":
seq2.append('<span background="lightblue">Q</span>')
elif letter == "F":
seq2.append('<span background="orange">F</span>')
elif letter == "W":
seq2.append('<span background="cyan">W</span>')
else:
seq2.append('<span background="white">%s</span>'%letter)
joinseq=join(seq2)
strseq=str(joinseq)
colorseq = strseq.replace("> <","><")
tmpliststore[name] = colorseq
.... ....
#appending the liststore
for seqname in names:
self.liststore.append([seqname,tmpliststore[seqname]])
... ...
self.cellspp = gtk.CellRendererText()
self.cellseqs = gtk.CellRendererText()
.... ....
#setting the cell attributes to the appropriate liststore column
self.spp.set_attributes(self.cellspp, markup=0)
self.seqs.set_attributes(self.cellseqs,markup=1)
# end #How many rows can you put in your tables before the performance starts to fall off?Each row contain at least 500 letters, and about seven rows turn the Treeview slow, and more than 15 turns the Treeview too slow.
I believe that the root of the problem is the great number of markups, because when I just open the file with only normal text, even 20 rows are not enough to turn the treeview slow. However, when I color the letters to turn the data analysis easier, the performance problem apear.
Thanks again,
FredFrederico Arnoldi wrote:
I have been working in a tool that display large sequences of data. Using
normal text it work's fine, but when I substitute the normal text by markup
text it get to slow. I have already tried set_fixed_height_mode, but didn't
work. Is it an algorithm or a processor/RAM memory problem?
Is there another way to improve the treeview performance?
_________________________________________________________________
MSN Messenger: converse online com seus amigos . http://messenger.msn.com.br
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
