user1277330
user1277330

Reputation: 63

How to get a list of the elements in TreeView? PyGtk

I have a treeview, with some elements in it. How can I get a list of all this data? Is there something similar to this,

self.treeview.GetItems()

Upvotes: 0

Views: 2048

Answers (1)

deinonychusaur
deinonychusaur

Reputation: 7304

I'd say you get the model:

model = self.treeview.get_model()

And then you have tons of different ways to access your data/items depending on what you want and how the model look... For more on that check http://pygtk.org

You could get first row by doing:

model[0]

And also you could iterate through it...

Upvotes: 2

Related Questions