- text = "*" * len(self.text)
- self.setText(text)
- #self.setText(self.text[0:self.currPos] + "_" + self.text[self.currPos] + "_" + self.text[self.currPos + 1:])
+ self.text = "*" * len(self.Text)
+ else:
+ self.text = self.Text.encode("utf-8")
+
+ def setText(self, text):
+ if not len(text):
+ self.currPos = 0
+ self.Text = u""
+ else:
+ try:
+ self.Text = text.decode("utf-8")
+ except UnicodeDecodeError:
+ print "utf8 kaputt!"
+ self.Text = text
+ self.update()