[pygtk] Bug in TreeView.scroll_to_cell()
Alessandro Pellizzari
shuriken at neko.it
Thu Jul 13 21:21:02 WST 2006
Greetings,
today I found what seems to be a bug in scroll_to_cell() of a TreeView.
I use select_path() to select a particular cell (just modified by the
user through another window), and scroll_to_cell() to show the selected
cell on the treeview.
My treeview has about 1500 rows.
It works pretty good until circa row 900, showing the cell at the top of
the treeview, then it begins going wrong, showing cell 930 (or similar)
at the top and not scrolling down, even for cell, e.g., 1200, which goes
out of the visible area.
I googled a partial solution (for a bug in Gtk 2.0.x), putting
while gtk.events_pending():
gtk.mainiteration()
before scroll_to_cell, but it shows the cell in the middle of the view
for a while (about cells 900-1000), scrolling down slowly, then always
show the cell as the last in the view.
The full code is:
if (self.magaddpath != 0):
# print self.magaddpath
selection = self["tv_mag_list"].get_selection()
while gtk.events_pending():
gtk.mainiteration()
self["tv_mag_list"].scroll_to_cell(self.magaddpath)
selection.select_path(self.magaddpath)
self.on_tv_mag_list_selected()
self.magaddpath=0
Is it a known bug? Is there a workaround, maybe to show always in the
middle or on top?
I use gtk 2.8.18 and pygtk 2.8.2, python 2.3.5 on a Debian etch
Thank you very much.
--
Alessandro Pellizzari
More information about the pygtk
mailing list