[wxPython-users] MemoryDC, GetFullTextExtent and Darwin

Christopher Barker Chris.Barker at noaa.gov
Mon Nov 6 14:59:32 PST 2006


Nigel W. Moriarty wrote:
> Chris
> =

> I have attached a file.  It works fine on Linux.  It just creates a BMP o=
bject but doesn't display it.
> =

> On MacOS it fails to get to the print bmp line.  I moved things around to=
 no avail.

You still don't have a bitmap created and selected into the MemoryDc =

before calling GetTextExtent() on it.

Enclosed is a version that work for me on Linux and OS-X. It crashes on =

OS-X if I comment out lines 22 and 23, which select a bitmap into the =

MemoryDC before using it.

I added displaying the bitmap jsut for the heck of it.

Note that you could perhaps create a ScreenDC or something to check your =

text size instead of creating a dummy bitmap.


-Chris

-- =

Christopher Barker, Ph.D.
Oceanographer
                                     		=

NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: textextent.py
Type: text/x-python
Size: 1230 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20061=
106/c91a81d5/textextent.py


More information about the wxpython-users mailing list