[Sugar-devel] [PATCH sugar-toolkit] Cursor moves to beginning while trying to edit activity instance name #2608

Anish Mangal anish at activitycentral.org
Mon Feb 14 21:50:17 EST 2011


On Mon, Feb 14, 2011 at 19:23, Aleksey Lim <alsroot at activitycentral.org> wrote:
> 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/src/sugar/activity/widgets.py
> +++ b/src/sugar/activity/widgets.py
> @@ -201,7 +201,9 @@ class TitleEntry(gtk.ToolItem):
>         self.entry.modify_bg(state, color)
>
>     def __jobject_updated_cb(self, jobject):
> +        prev_pos = self.entry.props.cursor_position
>         self.entry.set_text(jobject['title'])
> +        self.entry.set_position(prev_pos)
>
>     def __title_changed_cb(self, entry, activity):
>         if self._update_title_sid is not None:
> --
> 1.7.3.4
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>

Committed to dextrose/mainline

http://git.sugarlabs.org/dextrose/mainline/commit/c0204667f92962525e70e68683b1e9d8c31ab713

Reviewed-by: Anish Mangal <anish at sugarlabs.org>
Acked-by: Anish Mangal <anish at sugarlabs.org>


More information about the Sugar-devel mailing list