Allow for providing a ComboBox when instantiating a ToolComboBox.

This commit is contained in:
Tomeu Vizoso 2007-06-25 16:32:38 +02:00
parent 4b3c374455
commit 888148c6e6

View File

@ -21,12 +21,15 @@ from sugar.graphics.combobox import ComboBox
from sugar.graphics import units from sugar.graphics import units
class ToolComboBox(gtk.ToolItem): class ToolComboBox(gtk.ToolItem):
def __init__(self): def __init__(self, combo=None):
gtk.ToolItem.__init__(self) gtk.ToolItem.__init__(self)
self.set_border_width(units.microgrid_to_pixels(1)) 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.add(self.combo)
self.combo.show() self.combo.show()