I'm trying out a few pygtk tutorials and have run across a seemingly obvious newbie mistake, but for the life of me can't figure out what's going on here.
The error:
Traceback (most recent call last): File "main.py", line 8, in class Base: File "main.py", line 61, in Base cv.set_line_width(9) NameError: name 'cv' is not defined
The code:
def expose(self, widget, data=None):
cv = widget.window.cairo_create()
cv.set_line_width(9)
cv.set_source_rgb(0.7, 0.2, 0.0)
w = self.window.allocation.width
h = self.window.allocation.height
cv.translate(w/2, h/2)
cv.arc(0, 0, 50, 0, 2*math.pi)
cv.stroke_preserve()
cv.set_source_rgb(0.3, 0.4, 0.6)
cv.fill()
Here is the full source: http://gist.github.com/655728