Пример #1
0
class ViewController(object):
	'''Control widgets in main GUI window class View'''
	def __init__(self, parent):
		self.parent = parent
		self.view = RootView(parent)

	def introText(self):
		'''Parse and return contents in introtext.txt as a string'''
		filename = "introtext.txt"
		text=""
		try:
			f = open(filename, 'r')
			for line in f:
				text += line
		except Exception as e:
			print(e)
		finally:
			f.close()
		return text

	def run(self):
		'''Create elements in this frame'''
		self.view.createWidgets(self.introText())
		self.parent.mainloop()
		self.parent.destroy()
Пример #2
0
	def __init__(self, parent):
		self.parent = parent
		self.view = RootView(parent)