import PodSix
PodSix.engine = "pygame"
from PodSix.Resource import *

from PodSix.Game import Game
from PodSix.GUI.TextInput import TextInput

class Core(Game, EventMonitor):
	def __init__(self):
		gfx.Caption('Test Text Input')
		gfx.SetSize([320, 240])
		gfx.LoadFont("hemihead", 0.04, "default")
		gfx.LoadFont("VDUB", 0.04, "other")
		Game.__init__(self)
		EventMonitor.__init__(self)
		self.Add(TextInput({"centerx": 0.5, "centery": 0.1}, 0.7, "Test", dict([(x, chr(x)) for x in range(97, 122)])))
		self.Add(TextInput({"centerx": 0.5, "centery": 0.2}, 0.3, "Other font", font="other"))
	
	def Run(self):
		gfx.SetBackgroundColor([255, 255, 255])
		Game.Run(self)
		gfx.Flip()
	
	def KeyDown_escape(self, e):
		self.Quit()
	
	def Pump(self):
                Game.Pump(self)
                EventMonitor.Pump(self)

c = Core()
c.Launch()


