def make_list(self, width): cols = [(gobject.TYPE_INT, ""), (gobject.TYPE_INT, ""), (gobject.TYPE_STRING, _("Callsign")), ] self.listw = miscwidgets.KeyedListWidget(cols) self.listw.show() self.listw.set_editable(1, True) self.listw.connect("item-set", self._cs_changed) rend = self.listw.get_renderer(1) rend.set_property("family", "Monospace") rend.set_property("width-chars", width) sw = gtk.ScrolledWindow() sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) sw.add_with_viewport(self.listw) sw.show() return sw
def __init__(self, rthread, model): super(MappingNameEditor, self).__init__(rthread) self._model = model self._type = common.unpluralize(model.get_name()) types = [(gobject.TYPE_STRING, "key"), (gobject.TYPE_STRING, self._type), (gobject.TYPE_STRING, _("Name"))] self.listw = miscwidgets.KeyedListWidget(types) self.listw.set_editable(1, True) self.listw.set_sort_column(0, 1) self.listw.set_sort_column(1, -1) self.listw.show() self.mappings = [] sw = gtk.ScrolledWindow() sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) sw.add_with_viewport(self.listw) self.root = sw self._loaded = False