[wxPython] OGL gotchas

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] OGL gotchas

Arnold deVos-2
I am experimenting with OGL and I've noticed a few gotchas, perhaps others
have experience they can share...

1. wxShape.Erase seems to paint-out the shape with white no matter what the
canvas bg colour and no matter what DC I pass. You can see this if you
change the canvas bg in the ogl demo to something other than white, and then
move a shape about.

A bug in wxWindows (rather than wxPython) I suppose?

2.  It would be an improvement if wxShapeCanvas.FindShape returned the
*actual* python shape object rather than a new wxPyShapePtr.  The
wxPyShapePtr does not have any of the python attributes you may have added
to the original shape. (e.g. by inheritance)

Actually, it should be easy to return the original python shape object (with
a little more SWIG-ing) since it is saved in the C++ object (for dispatching
callbacks)....

- Arnold
---
Arnold deVos
Langdale Consultants
[hidden email]


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] OGL gotchas

Robin Dunn
>
> 1. wxShape.Erase seems to paint-out the shape with white no matter what
the
> canvas bg colour and no matter what DC I pass. You can see this if you
> change the canvas bg in the ogl demo to something other than white, and
then
> move a shape about.
>
> A bug in wxWindows (rather than wxPython) I suppose?
>

Yes it is.  I've noticed this before but forgot to make a note of it so I
would go back and see if it could be fixed without too much hassle.  Thanks
for the reminder.


> 2.  It would be an improvement if wxShapeCanvas.FindShape returned the
> *actual* python shape object rather than a new wxPyShapePtr.  The
> wxPyShapePtr does not have any of the python attributes you may have added
> to the original shape. (e.g. by inheritance)
>

This is an issue throughout wxPython.  Whenever a C++ object is returned
from a method SWIG just wraps a new shadow-class object around it.


> Actually, it should be easy to return the original python shape object
(with
> a little more SWIG-ing) since it is saved in the C++ object (for
dispatching
> callbacks)....
>

This could be made to work.  The one problem I see right off is that there
could be some shapes on the canvas that you didn't create, (so they won't
have a saved self pointer,) wxControlPoints for example.  It's a good idea
though, I'll think on it for a while and see what I can come up with.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users