[wxPython-users] buffered dc

Gabriel Murray gabriel.murray at gmail.com
Fri Jul 14 09:02:12 PDT 2006


Thanks, Robin! That solved it.
And the example wasn't meant to be efficient. I was just showing a dc that
involved a lot of redrawing to illustrate the issue.
Thanks again,
Gabriel

On 7/14/06, Robin Dunn <robin at alldunn.com> wrote:
>
> Gabriel Murray wrote:
> > Ah okay - I realized after looking at doodle.py that I was writing all
> > my lines in the OnPaint() method rather than in a separate DrawLines()
> > method. I've tried to alter my code to look like doodle.py's structure,
> > but now am not getting any output at all. This is supposed to be a small
> > box with a red background and half of it painted light blue. It seems
> > that the error is coming from the DrawLines() method but I don't see
> > what it is.
>
> The first problem is that you have an exception in the frame's __init__
> that you are not seeing because of the output being redirected, so the
> app is not starting.  (onPaint --> OnPaint)
>
> The main problem is that you are catching the panel's EVT_PAINT event,
> but in the event you are drawing to the frame, whose client area is
> totally obscured by the panel, so even if it draws anything it woudl not
> be seen anyway.  (self --> self.panel in OnPaint)
>
> Finally, there are *much* more efficient ways to draw a rectangle than
> drawing 62499 1 lines of length 1.
>
>
> --
> Robin Dunn
> Software Craftsman
> http://wxPython.org  Java give you jitters?  Relax with wxPython!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200607=
14/1a183203/attachment.htm


More information about the wxpython-users mailing list