def set_color(self,color, color_name=""): #print color, type(color) self.colorName = color_name if type(color)==gtk.gdk.Color: self._color = gdkColor2tuple(color) else: self._color = color self.notify_color_surface(self._color)
def cb_choose_color(self,*args): marker = self.__get_selected_marker() if marker==None: return old_color = marker.get_color() new_color = choose_one_color("New color for marker",tuple2gdkColor(old_color)) if old_color==new_color: return EventHandler().notify('color marker', marker, gdkColor2tuple(new_color)) EventHandler().notify('render now')
def choose_color(self, *args): dialog = gtk.ColorSelectionDialog('Choose default marker color') colorsel = dialog.colorsel colorsel.set_previous_color(self.lastColor) colorsel.set_current_color(self.lastColor) colorsel.set_has_palette(True) response = dialog.run() if response == gtk.RESPONSE_OK: color = colorsel.get_current_color() self.lastColor = color EventHandler().set_default_color(gdkColor2tuple(color)) dialog.destroy()
def set_default_color(self, *args): color = self.dc.get_color() EventHandler().set_default_color(gdkColor2tuple(color))
def cb_choose_color(self, *args): marker = self.__get_selected_marker() old_color = marker.get_color() new_color = choose_one_color("New color for marker", tuple2gdkColor(old_color)) EventHandler().notify("color marker", marker, gdkColor2tuple(new_color))