import ogl

I'm trying to use 'from wxPython import ogl' but I can't
define any shape.
An example:

class RoundedRectangleShape(ogl.RectangleShape):
    def __init__(self,w=0.0,h=0.0):
        ogl.RectangleShape.__init__(self,w,h)
        self.SetCornerRadius(-0.3)

This gives me an error: 'module' object has no atribute
'RectangleShape'
This error is in the first line. I've tried with wx instead
of ogl and with
wx.ogl and ogl.wx... but they doesn't work.
What is the right way?

Thanks.

try:

from wx import ogl

John Li wrote:

I'm trying to use 'from wxPython import ogl' but I can't
define any shape.
An example:

class RoundedRectangleShape(ogl.RectangleShape):
   def __init__(self,w=0.0,h=0.0):
       ogl.RectangleShape.__init__(self,w,h)
       self.SetCornerRadius(-0.3)

This gives me an error: 'module' object has no atribute
'RectangleShape'
This error is in the first line. I've tried with wx instead
of ogl and with
wx.ogl and ogl.wx... but they doesn't work.
What is the right way?

Thanks.

try:

from wx import ogl

Just to clairify a bit, names imported via the wxPython package (even
for non-core modules and sub-packages) will still have the wx prefix,
but names imported via the wx package will not. For example:

  from wxPython import ogl
  class RoundedRectangleShape(ogl.wxRectangleShape):
    ...
vs.
  from wx import ogl
  class RoundedRectangleShape(ogl.RectangleShape):
    ...

···

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