python-traitsui. Update property before completion of button fired

115 Views Asked by At

I am trying to get a property and GUI to update before the end of a button fired action. I feel like this should be straightforward but I am missing an update command or something.

The portion of the code is below:

item1 = Property(Str, depends_on = ['button1'])
button1 = Button('Perform Action')

myview = View(Item('button1'), Item('item1'))

def _get_item1(self):
        return somefunction()

def _button1_fired(self):
        dosomething1()
        dosomething2()

When the button is pressed, dosomething1() will change the output of somefunction(). And dosomething2() will change the output of somefunction() to something else. However when this is run the GUI will only update item1 after _button1_fired is finished.

Is there a way or a command to insert between the two dosomething() functions so that the GUI is updated "live"

0

There are 0 best solutions below