Show
Ignore:
Timestamp:
12/15/06 16:36:19 (2 years ago)
Author:
fdb
Message:

background command for transparent backgrounds

Location:
nodebox/trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • nodebox/trunk/src

    • Property svn:ignore set to
      *.pyc
  • nodebox/trunk/src/DrawingPrimitives.py

    r1 r41  
    903903 
    904904    def draw(self): 
     905        if self.background is not None: 
     906            self.background.set() 
     907            NSRectFill(((0,0), (self.width, self.height))) 
    905908        for cmd in self._grobs: 
    906909            cmd() 
    907             #grob._draw() 
    908910 
    909911    def append(self, el): 
     
    931933        self._colormode = RGB 
    932934        self._colorrange = 1.0 
    933         self._fillcolor = Color(self) 
     935        self._fillcolor = self.Color() 
    934936        self._strokecolor = None 
    935937        self._strokewidth = 1.0 
     938        self._canvas.background = self.Color(1.0) 
    936939        self._path = None 
    937940        self._autoclosepath = True 
     
    953956        return lib 
    954957 
    955     ### Sizing methods ### 
     958    ### Setup methods ### 
    956959 
    957960    def size(self, width, height): 
     
    973976    def speed(self, speed): 
    974977        self._canvas.speed = speed 
     978         
     979    def background(self, *args): 
     980        if len(args) > 0: 
     981            if len(args) == 1 and args[0] is None: 
     982                self._canvas.background = None 
     983            else: 
     984                self._canvas.background = self.Color(args) 
     985        return self._canvas.background 
    975986 
    976987    ### Variables ###