wxShapeCanvas problem

Hi everyone!
I start to learn wxPython but I having difficult to create the window when I have a wxShapeCanvas. I dont know very much so this program maybe is all wrong, so if someone could give me some advice to how create a window and insert a object (like a circle), in this window...

Tks for the helps.
Diego

from wxPython.wx import *
from wxPython.ogl import *

class MyFrame(wxShapeCanvas):
def __init__(self, parent, id):
wxShapeCanvas.__init__(self, parent, id, wxDefaultPosition, wxDefaultSize)
circ=wxCircleShape(40)
circ.Show(true)

class MyApp(wxApp):
def OnInit(self):
frame = MyFrame(NULL, -1)
frame.Show(true)
self.SetTopWindow(frame)
return true

app=MyApp(0)
app.MainLoop()

Diego Prestes wrote:

Hi everyone!
I start to learn wxPython but I having difficult to create the window when I have a wxShapeCanvas. I dont know very much so this program maybe is all wrong, so if someone could give me some advice to how create a window and insert a object (like a circle), in this window...

Tks for the helps.
Diego

from wxPython.wx import *
from wxPython.ogl import *

class MyFrame(wxShapeCanvas):

wxShapeCanvas is not a top-level window, so you can't use it as if it was one. You need to derive from wxFrame, and then create an instance of the wxShapeCanvas with the frame as a parent. Please see the demo.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!