]> granicus.if.org Git - python/commitdiff
__togglehex(): Simplify
authorBarry Warsaw <barry@python.org>
Tue, 6 Oct 1998 16:08:39 +0000 (16:08 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 6 Oct 1998 16:08:39 +0000 (16:08 +0000)
Tools/pynche/TypeinViewer.py

index d3dad51d71cc38859c533f706b5d05dc650653bc..6e50f0f9b8c4302cf926429a304a765220e60acb 100644 (file)
@@ -58,18 +58,8 @@ class TypeinViewer:
         self.__hex.grid(row=4, column=0, columnspan=2, sticky=W)
 
     def __togglehex(self, event=None):
-        rstr = self.__x.get()
-        gstr = self.__y.get()
-        bstr = self.__z.get()
-        if self.__hexp.get():
-            # it was decimal and is now hex
-            apply(self.update_yourself, tuple(map(int, (rstr, gstr, bstr))))
-        else:
-            # it was hex and is now decimal
-            red = string.atoi(rstr, 16)
-            green = string.atoi(gstr, 16)
-            blue = string.atoi(bstr, 16)
-            self.update_yourself(red, green, blue)
+        red, green, blue = self.__sb.current_rgb()
+        self.update_yourself(red, green, blue)
 
     def __normalize(self, event=None):
         ew = event.widget