Add clear button
Change-Id: I8e01e79d432b1c0ce77af0410eec79b30c98e6c3
Signed-off-by: Ryan Yin <100028731@mvla.net>
diff --git a/frc971/control_loops/python/spline_graph.py b/frc971/control_loops/python/spline_graph.py
index 258dcfa..e07bc80 100755
--- a/frc971/control_loops/python/spline_graph.py
+++ b/frc971/control_loops/python/spline_graph.py
@@ -20,6 +20,9 @@
self.connect(event, handler)
+ def clear_clicked(self, button):
+ self.field.clear_graph()
+
def output_json_clicked(self, button):
self.field.export_json(self.file_name_box.get_text())
@@ -129,6 +132,9 @@
self.input_json.set_size_request(100, 40)
self.input_json.connect("clicked", self.input_json_clicked)
+ self.clear = Gtk.Button.new_with_label("Clear")
+ self.clear.set_size_request(100, 40)
+ self.clear.connect("clicked", self.clear_clicked)
#Dropdown feature
self.label = Gtk.Label()
self.label.set_text("Change Field:")
@@ -169,6 +175,7 @@
jsonControls.add(self.file_name_box)
jsonControls.add(self.output_json)
jsonControls.add(self.input_json)
+ jsonControls.add(self.clear)
container.attach(jsonControls, 1, 0, 1, 1)
container.attach(self.label, 4, 0, 1, 1)