From 36c6f092fd964be00272a10dae3a86ba40fea542 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 24 Mar 2011 16:44:42 -0400 Subject: [PATCH] add Sketch, Shape, Line, Circle placeholder classes --- Circle.py | 3 +++ Line.py | 3 +++ Shape.py | 3 +++ Sketch.py | 10 ++++++++++ Window.py | 2 ++ 5 files changed, 21 insertions(+) create mode 100644 Circle.py create mode 100644 Line.py create mode 100644 Shape.py create mode 100644 Sketch.py diff --git a/Circle.py b/Circle.py new file mode 100644 index 0000000..f0c33d1 --- /dev/null +++ b/Circle.py @@ -0,0 +1,3 @@ + +class Circle(Shape): + pass diff --git a/Line.py b/Line.py new file mode 100644 index 0000000..a77ebef --- /dev/null +++ b/Line.py @@ -0,0 +1,3 @@ + +class Line(Shape): + pass diff --git a/Shape.py b/Shape.py new file mode 100644 index 0000000..518346a --- /dev/null +++ b/Shape.py @@ -0,0 +1,3 @@ + +class Shape(object): + pass diff --git a/Sketch.py b/Sketch.py new file mode 100644 index 0000000..5a83494 --- /dev/null +++ b/Sketch.py @@ -0,0 +1,10 @@ + +class Sketch(object): + def __init__(self): + self.shapes = [] + + def __iter__(self): + return self.shapes.__iter__() + + def __contains__(self, item): + return self.shapes.__contains__(item) diff --git a/Window.py b/Window.py index e25c853..7df1cce 100644 --- a/Window.py +++ b/Window.py @@ -4,6 +4,8 @@ import gtk.gtkgl from OpenGL.GL import * +from Sketch import Sketch + class Window: def __init__(self, title): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)