Commit initial
[oegtk/easy_starter.git] / test / test.py
1 #!/usr/bin/python3
2
3 from gi.repository import Gtk
4
5
6 class GladeWindowManager:
7     builder = Gtk.Builder()
8
9     @classmethod
10     def append(cls, glade_file):
11         cls.builder.add_from_file(glade_file)
12
13     @classmethod
14     def initWindow(cls, window_name, window_instance):
15         cls.builder.connect_signals(window_instance)
16         return cls.builder.get_object(window_name)
17
18
19 class TestMainWindow:
20
21     def on_window_destroy(self, widget, data=None):
22         Gtk.main_quit()
23
24     def __init__(self):
25         self.window = GladeWindowManager.initWindow("main_window", self)
26         self.window.show_all()
27
28     def on_start_button_clicked(self, widget, data=None):
29         print("Bravo")
30
31
32 if __name__ == "__main__":
33     GladeWindowManager.append("OpenERPEasyStarter.glade")
34     appli = TestMainWindow()
35     Gtk.main()