OK. So I have been running into this roadblock where I cant get the GUI to update based on what I am doing. I've searched extensively and tried to read but I am at my wits end almost. The closest Ive gotten is to remove the item from the "myclass.uncorrex_thing" and then run "edit_traits", but that just creates a new GUI over the old one...
Summary: I am getting a list of filenames from a .csv that has alot of items that change daily. I just want to be able to select the filename from a list on the GUI, press a button that does something to the file and checks that filename off the .csv list, then have the dropdown list on the GUI updated with the updated .csv
Here is my code so far
class My_List(HasTraits):
tracker = RecordKeeping()
uncorrex_items = tracker.get_uncorrected_list() #this creates a list of filenames based on a .csv file
uncorrex_items.insert(0,'Select file')
class DataFrameEditorDemo(HasTraits):
err_correct = PostProcessAutoErrorCorrection() #a separate module for correcting the files
myclass = Instance(My_List)
highlighted_thing = Str
Calc = Button('Run Corrections')
traits_view = View(
Item('Calc', label='correct file'),
Item("highlighted_thing", editor= EnumEditor(name = 'object.myclass.uncorrex_items')),
title="MyEditor"
)
def _Calc_fired(self):
if len(self.highlighted_thing) == 8:
self.err_correct.correct_form(self.highlighted_thing) #this corrects the file selected from the dropdown list
#AND it updates the .csv file so the file should be checked as complete and will not show up when "tracker.get_uncorrected_list()" is run again