Allow for providing a ComboBox when instantiating a ToolComboBox.
This commit is contained in:
parent
4b3c374455
commit
888148c6e6
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user