Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Area.py
diff options
context:
space:
mode:
authorAlexandre 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)
commitfc1f549a9711d6d5d91558295906fbc0f813f927 (patch)
tree8ddc33451afdd06466c98994c4d671863b5cc66b /Area.py
parent023e8784a6b67399ee4f383e9310b9677df7f1ef (diff)
Text tool improved.
Using a gtk.TextView to display text.
Diffstat (limited to 'Area.py')
-rw-r--r--Area.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Area.py b/Area.py
index 1f1984a..3d9499a 100644
--- a/Area.py
+++ b/Area.py
@@ -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