redraw and wxPyPlot

Hi,

I've a dialog with and wxPyPlot canvas. My problem is that when the dialog
is on and I change to oder program and go back the canvas doesn't redraw.
Do i need to bind an event with a redraw method?

Thanks in advance

Zunbeltz

···

--
Zunbeltz Izaola Azkona (zunbeltz at wm dot lc dot ehu dot es)
Materia Kondentsatuaren Fisika Saila |
Zientzia eta Teknologia Fakultatea | Telf: 34 946015326
Euskal Herriko Unibertsitatea |
PK 644 | Fax: 34 944648500
48080 Bilbo (SPAIN) |
--

Zunbeltz wrote:

Zunbeltz wrote:

Zunbeltz wrote:

Hi,

I've a dialog with and wxPyPlot canvas. My problem is that when the dialog
is on and I change to oder program and go back the canvas doesn't redraw.
Do i need to bind an event with a redraw method?

PlotCanvas is already binding to EVT_PAINT so it should be handling it
okay. Can you reduce your problem to a small sample to show us? That
will help solve any misunderstandings of your problem description.

Thanks for your reply. A small sample will be difficult but i would try to
explain better.

I have a program wich get data from a machine (via sockets.) Every time it
get a "point" it do a wxPostEvent (wxYield thing are from the WIKI).

           Point = (self.Position, Intensity)
           # EVENT
           wxPostEvent(self._notify_window, GetPointEvent(Point))
           wxYield()
           if self._want_abort == 1:
               return

What is the context that this code is run in? Is it in a loop? In a
thread other than the main gui thread? In the gui thread?

This code runs in a loop, no thread. At first I try the thread examples of
the wiki (long run section of the cookbook.

I expect that this is at least part of the problem. Although the wxYeild should be allowing it to process all events something seems to be preventing the delivery of the EVT_PAINT. I suppose it is possible that because control is not returning to the main event loop that the system doesn't think that the previous paint event is finished yet or something like that. You might try calling Refresh and/or Update to try and force it, but the best thing would be to move your data aquisition out of this loop somehow (using a thread, or even just breaking it up into idle or timer events,) and let control return to the main event loop.

Also, just to be sure double check the version of PlotWindow that you are using and ensure that it's binding of EVT_PAINT hasn't been commented out or something.

···

On Mon, 7 Jun 2004, Robin Dunn wrote:

On Fri, 4 Jun 2004, Robin Dunn wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!