Hi
How do I create my own shapes. What I need is a circle with a straight line
with going out from the circle. At the ende of this line there's another 90
degree line connected. It should look something like this:
O---|
Here are the demands for the shape:
- when I click on the circle the whole shape should be marked. When I click
on the lines only the lines should be marked
- resize/move
- drag. It should be possible to drag the lines without the dragging the
circle
- put text above the line
- it needs to be possible to connect the lines to other lines/shape. (Like
this: O---||---O)
Does somebody have an ide how to do this?
I've had a look at the DrawnShape, but I don't really understand how to use
it. Are there any good examples on the Internet. Can't find any myself.
Thomas
Maybe a wxCompositeShape using wxDivisionShape is the solution to my
question? If so, are there any examples on how to use it?
Thomas
You don't have to use the special "collector" shapes. I had only trouble
with them. You can simply create a class and generate all the shapes you
need in __init__. Then it becomes difficult. You have to write your own
wxShapeEvtHandler (start with the demo) and make all the selection,
dragging etc. stuff to your liking. Your computer might segfault once in a
while for garbage collection issues (C object already dead but python
object not yet collected). I have seen a python-only drawing demo together
with the MacOSX distribution and maybe I will scrap OGL for this.
Torsten
ยทยทยท
On Thu, 28 Aug 2003, Thomas Aanensen wrote:
Maybe a wxCompositeShape using wxDivisionShape is the solution to my
question? If so, are there any examples on how to use it?
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
"Torsten Sadowski" <moehl@akaflieg.extern.tu-berlin.de> wrote in message
news:Pine.LNX.4.44.0308281652330.29460-100000@akaflieg.extern.tu-berlin.de...
You don't have to use the special "collector" shapes. I had only trouble
with them. You can simply create a class and generate all the shapes you
need in __init__. Then it becomes difficult. You have to write your own
wxShapeEvtHandler (start with the demo) and make all the selection,
dragging etc. stuff to your liking. Your computer might segfault once in a
while for garbage collection issues (C object already dead but python
object not yet collected). I have seen a python-only drawing demo together
with the MacOSX distribution and maybe I will scrap OGL for this.
Is this really the best way to do it?
Can you provide me with a code sample of how you created your shapes?
Thomas