sweeCrypt-GTK/sweecrypt-gtk.py

40 lines
842 B
Python
Raw Normal View History

2024-09-07 19:39:45 -07:00
#!/usr/bin/env python
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
#
# main.py
# Copyright (C) 2024 Swee
#
from gi.repository import Gtk, GdkPixbuf, Gdk
import os, sys
#Comment the first line and uncomment the second before installing
#or making the tarball (alternatively, use project variables)
UI_FILE = os.path.dirname(os.path.realpath(__file__)) + "/sweecrypt-gtk.ui"
#UI_FILE = "/usr/local/share/sweecrypt_gui/ui/sweecrypt_gui.ui"
class GUI:
def __init__(self):
self.builder = Gtk.Builder()
self.builder.add_from_file(UI_FILE)
self.builder.connect_signals(self)
window = self.builder.get_object('window')
window.show_all()
def on_window_destroy(self, window):
Gtk.main_quit()
def main():
app = GUI()
Gtk.main()
if __name__ == "__main__":
sys.exit(main())