diff options
author | Alexandre Antonino Gonçalves Martinazzo <alexandremartinazzo@gmail.com> | 2007-08-24 18:49:44 (GMT) |
---|---|---|
committer | Alexandre Antonino Gonçalves Martinazzo <alexandremartinazzo@gmail.com> | 2007-08-24 18:49:44 (GMT) |
commit | fc1f549a9711d6d5d91558295906fbc0f813f927 (patch) | |
tree | 8ddc33451afdd06466c98994c4d671863b5cc66b /Area.py | |
parent | 023e8784a6b67399ee4f383e9310b9677df7f1ef (diff) |
Text tool improved.
Using a gtk.TextView to display text.
Diffstat (limited to 'Area.py')
-rw-r--r-- | Area.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -257,7 +257,14 @@ class Area(gtk.DrawingArea): # This fixes a bug that made the text viewer get stuck in the canvas elif self.estadoTexto is 1: - text = self.janela._textview.get_text() + try: + # This works for a gtk.Entry + text = self.janela._textview.get_text() + except: + # This works for a gtk.TextView + buf = self.janela._textview.get_buffer() + start, end = buf.get_bounds() + text = buf.get_text(start, end) if text is not None: self.d.text(widget,event) self.estadoTexto = 0 |