Hi everyone,
I found a class overview of ogl (wxWindows, Object Graphics Library).
Still haven't found much else. (gentoo linux here, I wonder if they put
it somewhere else? )
I have the following code. I'm just toying around with it and don't
succeed to get anything shown mostly (if not completely) due to my not
understanding how to use ogl
A strange thing is that it crashes the minute I click on the
wxShapeCanvas 'window'
Can anybody give me a pointer as to what I'm doing wrong or should be
doing?
Thank you.
Harold
#! /usr/bin/python
from wxPython.wx import *
from wxPython.ogl import *
class drawdocument(wxShapeCanvas):
def OnLeftClick(self,x,y,keys = 0):
print "left click"
def OnRightClick(self,x,y,keys = 0):
print "right click"
def __init__(self,parent,id,title,width,height):
wxShapeCanvas.__init__(self,parent,id,pos=(0,150),size=(width,height),style=wxBORDER)
EVT_RIGHT_UP(self, self.OnRightClick)
EVT_LEFT_UP(self,self.OnLeftClick)
myshape = wxDiagram()
myshape.SetCanvas(self)
cirkeltje = wxCircleShape(53.15)
myshape.AddShape(cirkeltje)
dc = wxClientDC(self)
myshape.DrawOutline(dc,2.0,2.0,10.0,10.0)
myshape.ShowAll(true)
class Gui(wxFrame):
def __init__(self,parent,id,title,width,height):
wxFrame.__init__(self,parent,id, title, size = (
width,height),
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
self.mypanel =
wxPanel(self,101,pos=(0,0),size=(640,150),style=wxTAB_TRAVERSAL)
self.mycanvas = drawdocument(self,100,"canvas",500,400)
self.mycanvas.SetBackgroundColour('white')
self.Show()
app = wxPyApp()
frame = Gui(None,-1,"Fusebox framework generator",640,480)
app.MainLoop()