diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-06-25 14:32:38 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-06-25 14:32:38 (GMT) |
commit | 888148c6e68f5d2b0ca943be2063fe3acb57b90f (patch) | |
tree | 4de2f396b2b8ab464f4831856b5d26d5711c40ab | |
parent | 4b3c374455c9a382b13f872011376ef1a34bafe1 (diff) |
Allow for providing a ComboBox when instantiating a ToolComboBox.
-rw-r--r-- | sugar/graphics/toolcombobox.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sugar/graphics/toolcombobox.py b/sugar/graphics/toolcombobox.py index 052bd23..b39465e 100644 --- a/sugar/graphics/toolcombobox.py +++ b/sugar/graphics/toolcombobox.py @@ -21,12 +21,15 @@ from sugar.graphics.combobox import ComboBox from sugar.graphics import units class ToolComboBox(gtk.ToolItem): - def __init__(self): + def __init__(self, combo=None): gtk.ToolItem.__init__(self) self.set_border_width(units.microgrid_to_pixels(1)) - self.combo = ComboBox() + if combo: + self.combo = combo + else: + self.combo = ComboBox() self.add(self.combo) self.combo.show() |