def submit_function(self, event): index = self.functions_list_box.GetSelection() fx = Graph.function(self.function_text_ctrl.GetValue(), self.function_name_text_ctrl.GetValue()) fx.will_graph = self.function_show_checkbox.GetValue() fx.line_color = self.function_color_combo_box.GetValue() fx.line_style = self.function_style_combo_box.GetValue() #Set the function Graph.function_list[index] = fx #Update the box self.setup_functions_list() event.Skip()