Tk Canvas text question

Fredrik Lundh fredrik at pythonware.com
Tue Aug 26 04:01:22 EDT 2003


Gary Richardson wrote:

> I've been working on a Python version of  Andreas Weber's ASCII
> schematic drawing program ( http://www.tech-chat.de) ; not that I
> thought I could do it better but just as a programming exercise.
> I've managed to put together something that more or less works
> but I'm puzzled by the way ASCII characters are displayed on a Canvas
> window. For example, in the code below (which produces my crude
> representation of an OpAmp), why are two leading blanks required in
> the text of the second create_text statement to cause the vertical bar to
> be aligned with the one above it? And why does the number of trailing
> blanks affect the position of the beginning of a line.

by default, text is centered around the given coordinate.  use anchor=NW
to align on the upper left corner, anchor=SW to align on the lower left, etc.

</F>








More information about the Python-list mailing list