From 2bb8eb1707ade340c10d51d908718f1c73a5f611 Mon Sep 17 00:00:00 2001
From: Aleksey Lim <alsroot@activitycentral.org>
Date: Mon, 14 Feb 2011 22:23:14 +0000
Subject: [PATCH sugar-toolkit] Cursor moves to beginning while trying to edit activity instance name #2608
This issue is not the same as #1948 but #1948 triggers this one.
In some cases set_text doesn't change cursor position but not in all cases.
---
src/sugar/activity/widgets.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/sugar/activity/widgets.py b/src/sugar/activity/widgets.py
index a8664d9..8d34855 100644
a
|
b
|
class TitleEntry(gtk.ToolItem): |
201 | 201 | self.entry.modify_bg(state, color) |
202 | 202 | |
203 | 203 | def __jobject_updated_cb(self, jobject): |
| 204 | prev_pos = self.entry.props.cursor_position |
204 | 205 | self.entry.set_text(jobject['title']) |
| 206 | self.entry.set_position(prev_pos) |
205 | 207 | |
206 | 208 | def __title_changed_cb(self, entry, activity): |
207 | 209 | if self._update_title_sid is not None: |