Update sweecrypt-gtk.py

This commit is contained in:
Swee 2024-09-09 16:27:59 -07:00
parent e6812c2a56
commit 18f96c7062

View file

@ -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: