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) self.builder.connect_signals(self)
window = self.builder.get_object('window') window = self.builder.get_object('window')
window.show_all() window.show_all()
def on_window_destroy(self, window): def toggle(self, e:bool):
Gtk.main_quit() if e:
def encode_toggle(self, encode): active = self.builder.get_object('encode').get_property("active")
active = encode.get_property("active")
print(f"Encode = {active}")
self.builder.get_object('decode').set_property("active", not active) self.builder.get_object('decode').set_property("active", not active)
def decode_toggle(self, decode): else:
active = decode.get_property("active") active = self.builder.get_object('decode').get_property("active")
print(f"Decode = {active}")
self.builder.get_object('encode').set_property("active", not 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): def start_clicked(self, start):
print("Start clicked!")
encode = self.builder.get_object('encode').get_property("active") encode = self.builder.get_object('encode').get_property("active")
inputted = self.builder.get_object('text').get_property("text") inputted = self.builder.get_object('text').get_property("text")
if encode: if encode: