mac 2,9 "Cannot nest wxDCs on the same window"
Vadim Zeitlin
vadim at wxwidgets.org
Mon Oct 1 10:40:22 PDT 2007
On Mon, 01 Oct 2007 09:55:15 -0700 Robin Dunn <robin at alldunn.com> wrote:
RD> Riccardo Cohen wrote:
RD> > Hi
RD> > I have a program that works on wxmac2,7 , but with 2,9 it displays the
RD> > following assertion : "Cannot nest wxDCs on the same window"
RD> >
RD> > this happens when I do
RD> >
RD> > wxClientDC *dc=new wxClientDC(diag);
RD> > dc->DrawRectangle(rec);
RD> > delete(dc);
RD> >
RD> > inside a timer_wake event.
RD> > I do not understand exactly what it means.
RD>
RD> You can not have more than one wxDC active at the same time for the same
RD> window. Somewhere you have another DC already using diag when the code
RD> above is called.
This seems like a rather bad restriction. I wonder if we couldn't make
all wxClientDC instances on the same window use the same underlying
CGContext somehow. It could still result in problems with changing DC
attributes but if we restored them carefully, it would allow something
(common) like this:
wxClientDC dc1(win);
...
{
wxClientDC dc2(win);
... use dc2 ...
}
... use dc1 ...
even if you still couldn't use more than one wxClientDC concurrently (which
is much less common).
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list