From ea103dc6d8f678d2240f72a6558e9c73ea429402 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 18 Oct 2006 11:14:02 -0400 Subject: [PATCH] Make SketchPad background color settable at object creation time rather than hardcoded to ugly green --- sugar/chat/sketchpad/SketchPad.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sugar/chat/sketchpad/SketchPad.py b/sugar/chat/sketchpad/SketchPad.py index f2512185..2b83240a 100644 --- a/sugar/chat/sketchpad/SketchPad.py +++ b/sugar/chat/sketchpad/SketchPad.py @@ -23,11 +23,12 @@ from SVGdraw import drawing from SVGdraw import svg class SketchPad(gtk.DrawingArea): - def __init__(self): + def __init__(self, bgcolor=(0.6, 1, 0.4)): gtk.DrawingArea.__init__(self) self._active_sketch = None self._rgb = (0.0, 0.0, 0.0) + self._bgcolor = bgcolor self._sketches = [] self.add_events(gtk.gdk.BUTTON_PRESS_MASK | @@ -46,7 +47,7 @@ class SketchPad(gtk.DrawingArea): rect = self.get_allocation() ctx = widget.window.cairo_create() - ctx.set_source_rgb(0.6, 1, 0.4) + ctx.set_source_rgb(self._bgcolor[0], self._bgcolor[1], self._bgcolor[2]) ctx.rectangle(0, 0, rect.width, rect.height) ctx.fill_preserve()