diff options
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -0,0 +1,33 @@ +''' +Created on 11 Jan 2013 + +@author: cgueret +''' +from gi.repository import Gtk, Gio +from Application import Main + +class QuizApplication(Gtk.Application): + def __init__(self): + Gtk.Application.__init__(self, application_id="nl.vu.quiz", flags=Gio.ApplicationFlags.FLAGS_NONE) + self.connect("activate", self.on_activate) + + def on_activate(self, data=None): + # Create the main part of the application + main = Main() + main_box = main.get_widget() + + # Create the window + window = Gtk.Window(type=Gtk.WindowType.TOPLEVEL) + window.set_default_size(600,450) + window.set_title("Quiz activity") + window.set_border_width(2) + window.set_position(Gtk.WindowPosition.CENTER) + window.add(main_box) + + # Show the window and add it to the application + window.show_all() + self.add_window(window) + +if __name__ == "__main__": + app = QuizApplication() + app.run(None) |