[PYTHON IMAGE-SIG] viewer.py gives TclError on Unix (includes patch)

Fredrik Lundh fredrik_lundh@ivab.se
Thu, 16 Jan 1997 14:50:03 +0100


The Script/viewer.py file only runs fine under Windows.  On a Unix
box, it gives the following error:

	TclError: unknown color name "systembuttonface"

See the attached patch for a quick workaround.

Regards	/F

--------------------------------------------------------------------

*** viewer.py.bak       Thu Jan 16 14:44:58 1997
--- viewer.py   Thu Jan 16 14:46:14 1997
***************
*** 38,45 ****
      #
      # handle transparent images
  
!     r, g, b = root.winfo_rgb("systembuttonface")
!     rgb = r / 256, g / 256, b / 256
  
      if im.mode == "P" and im.info.has_key("transparency"):
  
--- 38,48 ----
      #
      # handle transparent images
  
!     try:
!       r, g, b = root.winfo_rgb("systembuttonface")
!       rgb = r / 256, g / 256, b / 256
!     except TclError:
!       r = g = b = 0 # superimpose on black
  
      if im.mode == "P" and im.info.has_key("transparency"):

_______________
IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
_______________