From 65ee6d598a086ce3da4b0c0762465e80c869d048 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
Date: Wed, 19 Dec 2012 14:08:16 -0300
Subject: [PATCH toolkit] RadioToolButton: add active parameter to set the
active property in the constructor - SL #4323
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
This is because setting the active property after will emit a
'clicked' signal that makes the palette popup.
Also, call the parent's class constructor instead of GObject.GObject
one.
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
---
src/sugar3/graphics/radiotoolbutton.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/sugar3/graphics/radiotoolbutton.py b/src/sugar3/graphics/radiotoolbutton.py
index a51a39a..975776f 100644
a
|
b
|
class RadioToolButton(Gtk.RadioToolButton): |
33 | 33 | |
34 | 34 | __gtype_name__ = 'SugarRadioToolButton' |
35 | 35 | |
36 | | def __init__(self, icon_name=None, **kwargs): |
| 36 | def __init__(self, icon_name=None, active=None, **kwargs): |
37 | 37 | self._accelerator = None |
38 | 38 | self._tooltip = None |
39 | 39 | self._xo_color = None |
40 | 40 | self._hide_tooltip_on_click = True |
41 | 41 | |
42 | | self._palette_invoker = ToolInvoker() |
43 | | |
44 | | GObject.GObject.__init__(self, **kwargs) |
| 42 | Gtk.RadioToolButton.__init__(self, **kwargs) |
| 43 | if active is not None: |
| 44 | self.props.active = active |
45 | 45 | |
| 46 | self._palette_invoker = ToolInvoker() |
46 | 47 | self._palette_invoker.attach_tool(self) |
47 | 48 | |
48 | 49 | if icon_name: |