def __init__(self, icons):
super(OneConfViews, self).__init__()
model = Gtk.ListStore(GdkPixbuf.Pixbuf, GObject.TYPE_STRING,
GObject.TYPE_STRING)
model.set_sort_column_id(self.COL_HOSTNAME, Gtk.SortType.ASCENDING)
model.set_sort_func(self.COL_HOSTNAME, self._sort_hosts)
self.set_model(model)
self.set_headers_visible(False)
self.col = Gtk.TreeViewColumn('hostname')
hosticon_renderer = Gtk.CellRendererPixbuf()
hostname_renderer = Gtk.CellRendererText()
self.col.pack_start(hosticon_renderer, False)
self.col.add_attribute(hosticon_renderer, 'pixbuf', self.COL_ICON)
self.col.pack_start(hostname_renderer, True)
self.col.add_attribute(hostname_renderer, 'text', self.COL_HOSTNAME)
self.append_column(self.col)
self.current_hostid = None
self.hostids = []
# TODO: load the dynamic one (if present), later
self.default_computer_icon = icons.load_icon("computer", 22, 0)
self.connect("cursor-changed", self.on_cursor_changed)
评论列表
文章目录