Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/main.py
blob: 290380985428119963693ebcd6baf3be687a164e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)