Gonzalo,<div><br></div><div>Patch attached at the ticket site.</div><div><br></div><div>Manu<br><br><div class="gmail_quote">On Fri, Oct 22, 2010 at 12:30 AM, Gonzalo Odiard <span dir="ltr"><<a href="mailto:godiard@gmail.com">godiard@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Ok. Attach to the ticket please.<br><br>Gonzalo<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Thu, Oct 21, 2010 at 3:39 PM, <span dir="ltr"><<a href="mailto:anubhav@seeta.in" target="_blank">anubhav@seeta.in</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Condition added to save the text when added at last in the paint activity so<br>
that it does not disappear. Text disappeared when added at last in the paint<br>
activity.<br>
<div><br>
v1 -> v2. Updated at suggested<br>
<br>
</div>v2 -> v3. Variable name changed , there values changed<br>
<br>
v3 -> v4. The if condition updated as suggested<br>
<div><br>
Co-authored-by: Anubhav Aggarwal<<a href="mailto:anubhav@seeta.in" target="_blank">anubhav@seeta.in</a>>, Ishan Bansal <<a href="mailto:ishan@seeta.in" target="_blank">ishan@seeta.in</a>><br>
---<br>
Area.py | 6 +++---<br>
Desenho.py | 6 +++---<br>
</div> OficinaActivity.py | 2 ++<br>
3 files changed, 8 insertions(+), 6 deletions(-)<br>
<div><br>
diff --git a/Area.py b/Area.py<br>
</div>index 8843406..ba06758 100644<br>
<div>--- a/Area.py<br>
+++ b/Area.py<br>
</div>@@ -165,7 +165,7 @@ class Area(gtk.DrawingArea):<br>
<div> self.pixmap_sel = None<br>
self.desenho = []<br>
self.textos = []<br>
- self.estadoTexto = 0<br>
</div>+ self.text_in_progress = False<br>
<div> self.janela = janela<br>
self.d = Desenho(self)<br>
self.line_size = 2<br>
</div>@@ -325,7 +325,7 @@ class Area(gtk.DrawingArea):<br>
<div> self.d.text(widget, event)<br>
<br>
</div><div> # This fixes a bug that made the text viewer get stuck in the canvas<br>
- elif self.estadoTexto is 1:<br>
</div>+ elif self.text_in_progress:<br>
<div> try:<br>
# This works for a gtk.Entry<br>
text = self.janela.textview.get_text()<br>
</div>@@ -337,7 +337,7 @@ class Area(gtk.DrawingArea):<br>
<div><br>
if text is not None:<br>
</div><div> self.d.text(widget, event)<br>
</div>- self.estadoTexto = 0<br>
+ self.text_in_progress = False<br>
<div> self.janela.textview.hide()<br>
<br>
self.oldx, self.oldy = coords<br>
diff --git a/Desenho.py b/Desenho.py<br>
</div>index 3be1910..17525e5 100644<br>
<div>--- a/Desenho.py<br>
+++ b/Desenho.py<br>
</div>@@ -552,8 +552,8 @@ class Desenho:<br>
<div><br>
"""<br>
<br>
- if widget.estadoTexto == 0:<br>
- widget.estadoTexto = 1<br>
</div>+ if not widget.text_in_progress:<br>
+ widget.text_in_progress = True<br>
<div><br>
#widget.janela.fixed.move(widget.janela.textview,<br>
# int(event.x)+200, int(event.y)+100)<br>
</div>@@ -564,7 +564,7 @@ class Desenho:<br>
<div> widget.janela.textview.grab_focus()<br>
<br>
else:<br>
- widget.estadoTexto = 0<br>
</div>+ widget.text_in_progress = False<br>
<div><br>
try:<br>
# This works for a gtk.Entry<br>
diff --git a/OficinaActivity.py b/OficinaActivity.py<br>
</div>index 860d3fe..ec8910d 100644<br>
<div>--- a/OficinaActivity.py<br>
+++ b/OficinaActivity.py<br>
</div>@@ -169,6 +169,8 @@ class OficinaActivity(activity.Activity):<br>
<div> width, height = self.area.get_size_request()<br>
<br>
</div> logging.debug('writting %s w=%s h=%s' % (file_path, width, height))<br>
+ if self.area.text_in_progress:<br>
+ self.area.d.text(self.area, event=None)<br>
<br>
self.area.getout()<br>
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8,<br>
<font color="#888888">--<br>
1.7.0.4<br>
<br>
</font></blockquote></div><br><br clear="all"><br></div></div>-- <br><font color="#888888">Gonzalo Odiard<br><br><br>
</font><br>_______________________________________________<br>
Dextrose mailing list<br>
<a href="mailto:Dextrose@lists.sugarlabs.org">Dextrose@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/dextrose" target="_blank">http://lists.sugarlabs.org/listinfo/dextrose</a><br>
<br></blockquote></div><br></div>