From cc015a7b280b632a9f924a6cd4d332930f54fc21 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 20 Dec 2019 18:53:48 +0100 Subject: [PATCH] Applicazione di base funzionante. --- .gitignore | 1 + test.glade | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ test.py | 32 +++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 .gitignore create mode 100644 test.glade create mode 100644 test.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ceb386 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv diff --git a/test.glade b/test.glade new file mode 100644 index 0000000..92a4653 --- /dev/null +++ b/test.glade @@ -0,0 +1,81 @@ + + + + + + False + Applicazione di test con GLADE e Python + False + system-run + dialog + + + + + + + False + vertical + 2 + True + + + False + end + + + gtk-refresh + True + True + True + True + right + True + + + + True + True + 0 + + + + + gtk-quit + True + True + True + True + right + True + + + + True + True + 1 + + + + + False + False + 0 + + + + + True + False + Mostro il testo qui + + + False + True + 1 + + + + + + diff --git a/test.py b/test.py new file mode 100644 index 0000000..aca9111 --- /dev/null +++ b/test.py @@ -0,0 +1,32 @@ +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk + +class App: + + def on_btnUpdate_clicked(self, btn): + self.label.set_text("Aggiornato!") + + def on_btnQuit_clicked(self, btn): + Gtk.main_quit() + + def gtk_main_quit(self, btn): + Gtk.main_quit() + + def __init__(self): + self.builder = Gtk.Builder() + self.builder.add_from_file('test.glade') + self.builder.connect_signals(self) + + self.window = self.builder.get_object("windowMain") + self.window.show() + + self.label = self.builder.get_object("lblText") + + Gtk.main() + + def __destroy__(self): + Gtk.main_quit() + +if __name__ == '__main__': + a = App()