260
258
self.selected_col.set_selected(True)
261
259
self.emit("color-changed")
264
262
"""Callback: when adding a new color, show the color definition
265
263
window, update the model, notifies the parent."""
266
264
color_dialog = gtk.ColorSelectionDialog(_('Choose a color'))
267
265
colorsel = color_dialog.colorsel
268
266
if self.selected_col is not None:
269
267
color = gtk.gdk.color_parse(self.selected_col.color)
271
269
response = color_dialog.run()
273
271
# Check response_id and set color if required
274
272
if response == gtk.RESPONSE_OK and new_color:
275
273
strcolor = gtk.color_selection_palette_to_string([new_color])