Search code examples
pythonenthoughtanacondacanopytraitsui

How do I force the statusbar attribute of a Traits View object to update/redraw itself?


Ever since I switched from Canopy to Anaconda, the statusbar of my View is no longer updating itself dynamically, as my program runs. How can I force this to happen, at certain points within my program's execution?

I have this:

traits_view = View(

    {much code omitted.}

    statusbar = "status_str",
    title='PyBERT',
    width=1200, height=800
)

and status_str is updated several times during my program's run. Under Canopy, I used to see these changes occur in the GUI. Now, under Anaconda, I don't. So, I'd like to force them to occur. How do I do that?


Solution

  • I was able to restore dynamic status updating to my application, by giving the simulation proper its own thread to run in. Many thanks to @Gael Varoquaux for his excellent tutorial on this topic, which you'll find here:

    Breaking the flow in multiple threads