Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/graphics
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2007-07-24 09:29:14 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2007-07-24 09:29:14 (GMT)
commit1b292a7514b1e74c9504418b39ad37408d278dc5 (patch)
treeb5dfc5949ce8c3b79b2e0d1db48363593134662d /sugar/graphics
parent02149eba0a5000bb4951ad1672a310d851758ea9 (diff)
Combo for shared/private in the activity menu.
Diffstat (limited to 'sugar/graphics')
-rw-r--r--sugar/graphics/toolcombobox.py31
1 files changed, 28 insertions, 3 deletions
diff --git a/sugar/graphics/toolcombobox.py b/sugar/graphics/toolcombobox.py
index b39465e..01b308e 100644
--- a/sugar/graphics/toolcombobox.py
+++ b/sugar/graphics/toolcombobox.py
@@ -16,20 +16,45 @@
# Boston, MA 02111-1307, USA.
import gtk
+import gobject
from sugar.graphics.combobox import ComboBox
from sugar.graphics import units
+from sugar.graphics import style
class ToolComboBox(gtk.ToolItem):
- def __init__(self, combo=None):
- gtk.ToolItem.__init__(self)
+ __gproperties__ = {
+ 'label-text' : (str, None, None, None,
+ gobject.PARAM_WRITABLE),
+ }
+
+ def __init__(self, combo=None, **kwargs):
+ self.label = None
+ self._label_text = ''
+
+ gobject.GObject.__init__(self, **kwargs)
self.set_border_width(units.microgrid_to_pixels(1))
+ hbox = gtk.HBox(False, style.DEFAULT_SPACING)
+
+ self.label = gtk.Label(self._label_text)
+ hbox.pack_start(self.label, False)
+ self.label.show()
+
if combo:
self.combo = combo
else:
self.combo = ComboBox()
- self.add(self.combo)
+
+ hbox.pack_start(self.combo)
self.combo.show()
+ self.add(hbox)
+ hbox.show()
+
+ def do_set_property(self, pspec, value):
+ if pspec.name == 'label-text':
+ self._label_text = value
+ if self.label:
+ self.label.set_text(self._label_text)