diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2011-11-07 20:58:16 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2011-11-07 20:58:16 (GMT) |
commit | 6bc1e9f6576742a8d564786504d718bf6beff4d5 (patch) | |
tree | fa2d2da6fd4e38466882032587e3ee2a0272f94d /speak | |
parent | 3cf8cd02c59d3d615784aa6935713562c0ca5aa1 (diff) |
Remove custom widgets using hippo and use standard widgets
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'speak')
-rw-r--r-- | speak/widgets.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/speak/widgets.py b/speak/widgets.py index e20ae35..e3fffde 100644 --- a/speak/widgets.py +++ b/speak/widgets.py @@ -14,7 +14,7 @@ import logging -from port.widgets import ComboBox +from sugar.graphics.combobox import ComboBox import voice @@ -46,3 +46,19 @@ class Voices(ComboBox): self.face.status.voice = self.props.value finally: self.handler_unblock_by_func(self._changed_cb) + + def select(self, id=None, name=None): + if id is not None: + column = 0 + value = id + elif name is not None: + column = 1 + value = name + else: + return + + for i, item in enumerate(self.get_model()): + if item[column] != value: + continue + self.set_active(i) + break |