#!/usr/bin/env python
import gtk
from kiwi.ui.objectlist import ObjectList, Column
class NewsItem:
    """An instance that holds information about a news article."""
    def __init__(self, title, author, url):
        self.title, self.author, self.url = title, author, url
# Assemble friendly Pigdog.org news into NewsItem instances so they can
# be used in the ObjectList
news = [
 NewsItem("Smallpox Vaccinations for EVERYONE", "JRoyale",
 NewsItem("Is that uranium in your pocket or are you just happy to see me?",
          "Baron Earl",
 NewsItem("Cut 'n Paste", "Baron Earl",
 NewsItem("A Slippery Exit", "Reverend CyberSatan",
 NewsItem("Those Crazy Dutch Have Resurrected Elvis", "Miss Conduct",
# Specify the columns: one for each attribute of NewsItem, the URL
# column invisible by default
my_columns = [Column("title", sorted=True),
              Column("author", justify=gtk.JUSTIFY_RIGHT),
              Column("url", title="URL", visible=False)]
objectlist = ObjectList(my_columns)
w = gtk.Window()
w.connect('delete-event', gtk.main_quit)
w.set_size_request(600, 250)