[PythonCAD] Execution path

Russell Shaw rjshaw at netspace.net.au
Wed Sep 1 18:23:42 CEST 2004


Art Haas wrote:
> On Wed, Sep 01, 2004 at 09:04:24PM +1000, Russell Shaw wrote:
> 
>>Hi,
>>I downloaded the code to see how it works. I'm interested in
>>drawing/cad programs.
>>
>>I looked in PythonCAD-DS1-R16/gtkpycad.py. Where are the
>>callbacks for mouseclicks set up?
> 
> 
> Hi.
> 
> The mouse click callbacks are in Interface/Gtk/gtkimage.py for handling
> the clicking in the drawing area. The clicks for creating the various
> entities are handled in by the Tool class. They get set/unset in the
> files in Interface/Gtk like gtkentities.py, gtkmodify.py,
> gtkdimension.py, etc. Look for lines that say something like: 
> 
> tool.setHandler("button_press", ...)
> 
> Art

Hi,
I had a look thru more of the code, but can't see the forest thru
the trees. I've made programs in python and gtk, and pygtk before.
Is there a debugger that lets you single-step thru the python code?

I'm trying to get an overall idea of how the app works in a high-level
kind of way, such as how the app guides the user thru a series of steps
when drawing a shape:

First i select:

   Draw|Basic|Rectangles

   Statusbar: Click in the drawing area or enter a point

Does this menu cause a new callback for mouse-clicks to be connected somewhere? 
Which one?

I move the mouse to a second point. Which callback is doing the redrawing
of the rectangle in response to mouse movement? Is this callback always
connected, or is it specific to each object being drawn?

I click a point:

   Statusbar: Enter the second point or click in the drawing area

Which function holds this series of steps (or context) that guides
the user thru each action of drawing a rectangle?

I click the second point and the rectangle is drawn.


I have lots of ideas for lots of cad programs, but am wondering
about what 'architecture' to use.


More information about the PythonCAD mailing list