Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-02-13 17:09:45 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-02-13 17:09:45 (GMT)
commitb4a461605da6876867857a3477001fa9447da5eb (patch)
tree02ef92c2dca38cab764af0c0af867140d6d160fc
parentb48c5c0beb07039bdd0cef3bd0973d29e5b8254d (diff)
Label fixes.
-rw-r--r--sugar/graphics/label.py24
-rwxr-xr-xtests/test-label.py4
2 files changed, 7 insertions, 21 deletions
diff --git a/sugar/graphics/label.py b/sugar/graphics/label.py
index 6d580f0..08deff3 100644
--- a/sugar/graphics/label.py
+++ b/sugar/graphics/label.py
@@ -34,16 +34,11 @@ class Label(hippo.CanvasBox, hippo.CanvasItem):
'text' : (str, None, None, None,
gobject.PARAM_READWRITE)
}
-
- __gsignals__ = {
- 'button-activated': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([int]))
- }
- def __init__(self, text):
+ def __init__(self, text=None):
hippo.CanvasBox.__init__(self, orientation=hippo.ORIENTATION_HORIZONTAL)
self.props.yalign = hippo.ALIGNMENT_CENTER
- self._buttons = {}
self._text = text
self._round_box = RoundBox()
@@ -60,17 +55,8 @@ class Label(hippo.CanvasBox, hippo.CanvasItem):
self._round_box.append(self._canvas_text, hippo.PACK_EXPAND)
- def add_button(self, icon_name, action_id):
- button = Button(icon_name=icon_name)
-
- button.props.scale = style.small_icon_scale
-
- button.props.yalign = hippo.ALIGNMENT_CENTER
- button.props.xalign = hippo.ALIGNMENT_START
-
- button.connect('activated', self._button_activated_cb)
- self._round_box.append(button)
- self._buttons[button] = action_id
+ def do_set_property(self, pspec, value):
+ self._canvas_text.set_property(pspec.name, value)
- def _button_activated_cb(self, button):
- self.emit('button-activated', self._buttons[button])
+ def do_get_property(self, pspec):
+ return self._canvas_text.get_property(pspec.name)
diff --git a/tests/test-label.py b/tests/test-label.py
index 4b9b534..fd6b841 100755
--- a/tests/test-label.py
+++ b/tests/test-label.py
@@ -45,8 +45,8 @@ toolbar.append(button)
label = Label('mec moc')
toolbar.append(label)
-label = Label('mac mic')
-label.add_button('theme:stock-close', BUTTON_DELETE)
+label = Label()
+label.props.text = 'mac mic'
toolbar.append(label)
gtk.main()