def METHOD_NAME(self):
    l = self.listbox.item
    patterns = [str(l(z).text()) for z in range(self.listbox.count())]
    row = self.listbox.currentRow()
    if row < 0:
        row = 0
    (text, ok) = QInputDialog().getItem(self, 'puddletag',
                                        self.addText, patterns, row)
    if ok:
        self.listbox.clearSelection()
        self.listbox.METHOD_NAME(text)
        self.listbox.setCurrentRow(self.listbox.count() - 1)