2006-05-12 Alex Roitman <shura@gramps-project.org>

* src/GrampsCfg.py (add_color): Update text label after color change.



svn: r6638
This commit is contained in:
Alex Roitman 2006-05-13 04:30:47 +00:00
parent 3bcc0dd4ff
commit b9cc6e8bf0
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,6 @@
2006-05-12 Alex Roitman <shura@gramps-project.org>
* src/GrampsCfg.py (add_color): Update text label after color change.
2006-05-12 Don Allingham <don@gramps-project.org>
* src/ViewManager.py: move ScratchPad to Edit
* src/GrampsCfg.py: fix color dialog buttons

View File

@ -272,21 +272,22 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
hexval = Config.get(constant)
color = gtk.gdk.color_parse(hexval)
entry = gtk.ColorButton(color=color)
entry.connect('color-set', self.update_color, constant)
color_hex_label = BasicLabel(hexval)
entry.connect('color-set',self.update_color,constant,color_hex_label)
table.attach(lwidget, 0, 1, index, index+1, yoptions=0,
xoptions=gtk.FILL)
table.attach(entry, 1, 2, index, index+1, yoptions=0, xoptions=0)
table.attach(BasicLabel(hexval), 2, 3, index, index+1,
yoptions=0)
table.attach(color_hex_label, 2, 3, index, index+1, yoptions=0)
def update_entry(self, obj, constant):
Config.set(constant, unicode(obj.get_text()))
def update_color(self, obj, constant):
def update_color(self, obj, constant, color_hex_label):
color = obj.get_color()
hexval = "#%02x%02x%02x" % (color.red/256,
color.green/256,
color.blue/256)
color_hex_label.set_text(hexval)
Config.set(constant, hexval)
def update_checkbox(self, obj, constant):