Python 2.4.3 (#1, Apr 7 2006, 10:54:33)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on
darwin
Type "help", "copyright", "credits" or "license" for
more information.
width, height, d, e =
memory.GetFullTextExtent(self.text)
File
"//Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/wx-2.6-mac-unicode/wx/_gdi.py",
line 3445, in GetFullTextExtent
return _gdi_.DC_GetFullTextExtent(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion
"wxAssertFailure" failed in
/BUILD/wxPython-src-2.6.3.3/src/mac/carbon/dc.cpp(1482):
Invalid DC
Any ideas
Nigel
···
---
Nigel W. Moriarty
__________________________________________________________________________________________
Check out the New Yahoo! Mail - Fire up a more powerful email and get things done faster.
(http://advision.webevents.yahoo.com/mailbeta)
I'm trying to port a working GUI to Darwin
def ConstructBMP(self):
memory = wxMemoryDC()
border = 10
width, height, d, e =
memory.GetFullTextExtent(self.text)
Invalid DC
I haven't tested it, but a wxMemoryDC may be invalid if it hasn't had a bitmap selected into it yet. Try:
Of course you may be trying to find out how big the text is to that you know how big to make the Bitmap. In that case, you can either make a new on after getting the size, of maybe use a wx.ScreenDC or other DC to do your text measurement, then create the wx.MemoryDC
-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
Of course you may be trying to find out how big the text is to that you
know how big to make the Bitmap. In that case, you can either make a new
on after getting the size, of maybe use a wx.ScreenDC or other DC to do
your text measurement, then create the wx.MemoryDC
Uhm, I don't think the size of the bitmap matters... but maybe on
Darwin is different than on Windows:
Of course you may be trying to find out how big the text is to that you
know how big to make the Bitmap. In that case, you can either make a new
on after getting the size, of maybe use a wx.ScreenDC or other DC to do
your text measurement, then create the wx.MemoryDC
Uhm, I don't think the size of the bitmap matters... but maybe on
Darwin is different than on Windows:
you're right -- but that's not what I meant. What I was imagining was that the OP was trying to make a bitmap large enough to to hold a given text string -- to do that, you'd need to know how large it was before you could make the bitmap.
-CHB
···
--
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
you're right -- but that's not what I meant. What I was imagining was
that the OP was trying to make a bitmap large enough to to hold a given
text string -- to do that, you'd need to know how large it was before
you could make the bitmap.
Sorry, I did not understand correctly what you meant. Yes, if this is
the final target of the code, you have to know if advance how large is
the text indeed. Sorry for my somewhat approximative mastering of the
english language
I'm trying to port a working GUI to Darwin
def ConstructBMP(self):
memory = wxMemoryDC()
border = 10
width, height, d, e =
memory.GetFullTextExtent(self.text)
Invalid DC
I haven't tested it, but a wxMemoryDC may be invalid if it hasn't had a bitmap selected into it yet.
That is correct.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!