rup
rup

Reputation: 982

How to populate a PyGTK TreeView from a very long list?

In my PyGTK GUI, I am populating a TreeView from a ListStore. The ListStore contains 3 string fields, and this data is read into the store from a plain text file. The TreeView is set in a ScrolledWindow. The list is very long, about 80K lines, which means my ListStore list will be 80K items long. The program takes a long time to populate the TreeView. What techniques are there to avoid reading into memory the whole list in its entirety. How can I read it in steps ? And on what event should I invoke this read-into-ListStore routine ?

Upvotes: 0

Views: 448

Answers (1)

eduffy
eduffy

Reputation: 40262

There are some tips in the PyGTK FAQ about loading long lists and keeping your UI responsive while loading.

Upvotes: 2

Related Questions