<br><br><div class="gmail_quote">On Thu, May 19, 2011 at 10:26 AM, Gonzalo Odiard <span dir="ltr"><<a href="mailto:godiard@sugarlabs.org">godiard@sugarlabs.org</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;">
---<br>
book.py | 5 ++++-<br>
bookview.py | 1 -<br>
2 files changed, 4 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/book.py b/book.py<br>
index 681bdba..f28ff99 100644<br>
--- a/book.py<br>
+++ b/book.py<br>
@@ -71,11 +71,14 @@ class Book(gobject.GObject):<br>
<br>
self._article.uid = entry['uid']<br>
self._article.article_title = title<br>
- self.emit('article-selected', self._article)<br>
+ gobject.idle_add(self._emit_article_selected)<br>
<br>
article = gobject.property(type=object,<br>
getter=get_article, setter=set_article)<br>
<br>
+ def _emit_article_selected(self):<br>
+ self.emit('article-selected', self._article)<br>
+<br>
# save current article<br>
def sync_article(self):<br>
# stub<br>
diff --git a/bookview.py b/bookview.py<br>
index dfbb205..8b049d6 100644<br>
--- a/bookview.py<br>
+++ b/bookview.py<br>
@@ -154,7 +154,6 @@ class BookView(gtk.VBox):<br>
<br>
self.book.props.article = article<br>
self.store.append((False, article))<br>
- self.tree.set_cursor(len(self.store)-1, self.tree.get_column(1), False)<br>
<br>
def _create_cb(self, widget):<br>
def find_name(list, prefix, uniq):<br>
<font color="#888888">--<br>
1.7.4.4<br>
<br>
_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</font></blockquote></div><br>I am not very familiar with treeview, but the "path" in the set_cursor call seems to be OK (just ran some tests) but maybe it is a race condition of some sort: pointing to the new last entry in the list before the list knows it has a new last entry? In any case, simply eliminating the call to set_cursor seems to be enough to address the crash problem. What is the first part of the patch trying to accomplish?<br>
<br>-walter<br><br>-- <br>Walter Bender<br>Sugar Labs<br><a href="http://www.sugarlabs.org">http://www.sugarlabs.org</a><br><br>