Ejemplo n.º 1
0
 def test_ctr(self):
     w = LibraryValueCompletion("artist", SongLibrary())
     e = Gtk.Entry()
     e.set_completion(w)
     self.failUnlessEqual(w.get_entry(), e)
     self.failUnlessEqual(e.get_completion(), w)
     e.destroy()
Ejemplo n.º 2
0
    def __value_editing_started(self, render, editable, path, model, library):
        if not editable.get_completion():
            tag = model[path][0].tag
            completion = LibraryValueCompletion(tag, library)
            editable.set_completion(completion)

        if isinstance(editable, Gtk.Entry):
            comment = model[path][0].value
            if comment.shared:
                editable.set_text(comment.text)
            else:
                editable.set_text(u"")