Permalink
Browse files

I'm crazy!

  • Loading branch information...
1 parent f5df4e9 commit f2be46bafdc0f3f9440a303d9d017e71f2b6e40d Ram Rachum committed May 9, 2009
Showing with 92 additions and 0 deletions.
  1. +17 −0 .project
  2. +11 −0 .pydevproject
  3. +5 −0 src/customshell.py
  4. BIN src/customshell.pyc
  5. +26 −0 src/main.py
  6. +33 −0 src/turtlewidget.py
  7. BIN src/turtlewidget.pyc
View
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>PythonTurtle</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.python.pydev.PyDevBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.python.pydev.pythonNature</nature>
+ </natures>
+</projectDescription>
View
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-pydev version="1.0"?>
+
+<pydev_project>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
+<path>/PythonTurtle</path>
+<path>/PythonTurtle/src</path>
+</pydev_pathproperty>
+</pydev_project>
View
@@ -0,0 +1,5 @@
+import wx
+import wx.py.shell as wxshell
+
+class CustomShell(wxshell.Shell):
+ pass
View
Binary file not shown.
View
@@ -0,0 +1,26 @@
+import wx
+import customshell
+import turtlewidget
+
+class ApplicationWindow(wx.Frame):
+ """
+ """
+ def __init__(self,*args,**keywords):
+ wx.Frame.__init__(self,*args,**keywords)
+ self.SetDoubleBuffered(True)
+ splitter=self.splitter = wx.SplitterWindow(self, style=wx.SP_LIVE_UPDATE)
+ turtle_widget=self.turtle_widget=turtlewidget.TurtleWidget(self.splitter)
+ shell=self.shell=customshell.CustomShell(self.splitter)
+ splitter.SplitHorizontally(turtle_widget,shell,splitter.GetSize()[1]-250)
+ splitter.SetSashGravity(1)
+
+ sizer=self.sizer=wx.BoxSizer(wx.VERTICAL)
+ sizer.Add(splitter,1,wx.EXPAND)
+ self.SetSizer(sizer)
+
+ self.Show()
+
+if __name__=="__main__":
+ app = wx.PySimpleApp()
+ my_app_win=ApplicationWindow(None,-1,"PythonTurtle",size=(600,600))
+ app.MainLoop()
View
@@ -0,0 +1,33 @@
+import wx
+
+
+
+class TurtleWidget(wx.Panel):
+ def __init__(self,*args,**kwargs):
+ wx.Panel.__init__(self,style=wx.SUNKEN_BORDER,*args,**kwargs)
+ BACKGROUND_COLOR=self.BACKGROUND_COLOR=wx.Colour(212,208,200)
+ turtle=self.turtle=Turtle
+ bitmap=self.bitmap=wx.EmptyBitmapRGBA(2000,1200,BACKGROUND_COLOR[0],BACKGROUND_COLOR[1],BACKGROUND_COLOR[2],255) # todo: Change to something smarter?
+ self.Bind(wx.EVT_PAINT, self.on_paint)
+ self.Bind(wx.EVT_SIZE,self.on_size)
+
+
+
+
+ pass
+
+ def on_paint(self,e=None):
+ dc=wx.PaintDC(self)
+ dc.DrawBitmap(self.bitmap,0,0)
+ dc.Destroy()
+
+ def on_size(self,e=None):
+ self.Refresh()
+
+
+
+class Turtle(object):
+ def __init__(self):
+ self.pos=(0,0)
+ self.orientation=0
+ self.color=wx.NamedColor("Black")
View
Binary file not shown.

0 comments on commit f2be46b

Please sign in to comment.