PythonWin gurus - PyCDC.DrawText() help - bad doc?

Conrad cwren1 at cfl!rr.com
Fri Oct 24 11:54:38 EDT 2003


Greetings,

I have some simple printing I need to do from Python
on Windows, so I opted for the excellent PyCDC methods.

I got stumped when I realized that I actually needed
something other than left-justified printing for this
project. PyCDC.DrawText appears to offer what I need,
but the doc at:

http://aspn.activestate.com/ASPN/docs/ActivePython/PythonWin/PyCDC__DrawText_meth.html

says:

_________________________
PyCDC.DrawText

s,rc,forat = DrawText()

Formats text in the given rectangle

Return Value
Height of text in pixels

_________________________

This looks more than a little odd to me.
For one, the text specifies what is probably
a return type of int (height in pixels),
but the template (s,rc,forat = DrawText())
shows a totally different type of return.
Additionally, DrawText apparently takes no
aguments. Very odd.

I would have expected something more like
the DrawFrameControl doc, which looks like
this:

__________________________
PyCDC.DrawFrameControl

DrawFrameControl(rect, typ, state)

Draws a frame control of the specified type and style.

Parameters

rect : (left, top, right, bottom)

    Specifies the bounding rectangle, in logical units.

typ : int

state : int

    MFC References

CDC::DrawFrameContr

__________________________

Does anyone out there have an example of
using DrawText to right or center justify
text? And who do I contact regarding the
suspect doc?

Many thanks,

Conrad






More information about the Python-list mailing list