question about animation and widgets

in fact that may become clearer with my code.
There are two classes. One does the animation. The other is supposed to add a button. The infinite loop is at the end


Greg Willden a �crit : (4.1 KB)


Hi Bruno,

Which method are you using to do the animation?
Timer, Idle Event?

If you are using a timer then it is pretty straightforward to start and stop the timer from the handler for the button you added.

I am using wxPython and I've hacked the example.

You need functions like this:
timer = wx.Timer(panel,TIMER_ID)
wx.EVT_TIMER(panel,TIMER_ID, update_line) << Here you bind the timer to your update function



On 8/16/07, *bruno* <bruno.chazelas@...1698... > <mailto:bruno.chazelas@…1698…>> wrote:


    I am probably reinventing the wheel. I am trying to get "rolling"
    a la labview with matplotlib. I have more or less managed to get
    what I
    want using the simple animation technique provided by matplotlib. I
    would like now to have a button an the same graph that would enable me
    to stop the program that is in an infinite acquisition loop.

    I have managed to use a matplotlib widget with the graph to make it
    print something on a terminal, however I do not see how to make it
    an infinite loop. I have tried to make the button change the state
    of a
    variable and give the state of this variable a a stop condition to the
    loop. However this doesn't work. In fact the button doesen't seems
    to be
    "listening" during the loop.

    Any idea of how I should be doing that ?



    This email is sponsored by: Splunk Inc.
    Still grepping through log files to find problems? Stop.
    Now Search log events and configuration files using AJAX and a
    Download your FREE copy of Splunk now >>
    Matplotlib-users mailing list
    matplotlib-users List Signup and Options

Linux. Because rebooting is for adding hardware.