views:

40

answers:

1

What's the easieest way to create a sorted table view in gtk? I'm not sure if that's the right term, but you know the one:

sorted table image

Is there a built-in widget for this? If not, how would I go about making those columns that look slightly different, click to change sorting, etc. Note I don't need multi-column sorting at the moment.

+2  A: 

Sorted List Stores

UPDATE:

After looking at your edit (disregarding commens):

  • There is no built-in widget, but ListView = TreeView + ListStore
  • Clicking to change sorting is harder, but probably not by much

Remember that most anything is handled by their tutorial, at PyGTK.org (HTML) and in PDF Format. They also have a PyGTK Refrence, if that suits you better.

new123456
ah looks about right, I'll look into it. why's that stuff called TreeModel and such ?
Claudiu
That's the generic ListStore and TreeStore interface. That's what TreeViews load their items from.
new123456
i mean why's it called a TreeView if it's just a list of items I'm viewing? I guess a list is just a flat tree..
Claudiu
Yes, it's just for simplicity. Although, in my opionion, ListStore is just as much a hack as any ListView control would be.
new123456