diff --git a/sweecrypt-gtk.py b/sweecrypt-gtk.py index 511db4c..c57a1e4 100644 --- a/sweecrypt-gtk.py +++ b/sweecrypt-gtk.py @@ -11,18 +11,17 @@ class GUI: self.builder.connect_signals(self) window = self.builder.get_object('window') window.show_all() - def on_window_destroy(self, window): - Gtk.main_quit() - def encode_toggle(self, encode): - active = encode.get_property("active") - print(f"Encode = {active}") - self.builder.get_object('decode').set_property("active", not active) - def decode_toggle(self, decode): - active = decode.get_property("active") - print(f"Decode = {active}") - self.builder.get_object('encode').set_property("active", not active) + def toggle(self, e:bool): + if e: + active = self.builder.get_object('encode').get_property("active") + self.builder.get_object('decode').set_property("active", not active) + else: + active = self.builder.get_object('decode').get_property("active") + self.builder.get_object('encode').set_property("active", not active) + def on_window_destroy(self, window):Gtk.main_quit() + def encode_toggle(self, encode):self.toggle(True) + def decode_toggle(self, decode):self.toggle(False) def start_clicked(self, start): - print("Start clicked!") encode = self.builder.get_object('encode').get_property("active") inputted = self.builder.get_object('text').get_property("text") if encode: