Esempio n. 1
0
	def __exit__(self,exc_type,exc_value,traceback):
		UIState.endLayout()
#		if self.size:
#			size = self.size
#		else:
		size = (self.curpos[0]-self.pos[0],self.maxsize[1])
			
		UIState.updateLayout(self.pos,size)
Esempio n. 2
0
	def __enter__(self):
		self.pos,self.size = UIState.doLayout(self.pos,self.size)
		self.pos = self.pos or (0,0)
		if not self.size:
			w,h = UIState.getScreenSize()
			self.size = (w-self.pos[0],h-self.pos[1])
			
		self.curpos = self.pos
		
		UIState.beginLayout(self)
Esempio n. 3
0
	def __init__(self, size,**kwargs):
		pygame.init()
		self.icon = None
		
		if "title" in kwargs:
			pygame.display.set_caption(kwargs['title'])
		if "icon" in kwargs:
			self.icon = pygame.image.load(kwargs['icon'])
			pygame.display.set_icon(self.icon)

		self.size = size
		flags = HWSURFACE|DOUBLEBUF|RESIZABLE
		self.opengl =  "opengl" in kwargs
		
		if self.opengl:
			flags |= OPENGL
			
		self.screen = pygame.display.set_mode(size, flags,32)
		
		if self.opengl: 
			self.initGL(*self.size)
			UIState.setFlag("opengl",True)
Esempio n. 4
0
	def __enter__(self):
		self.pos,self.size = UIState.doLayout(self.pos,self.size)
		self.curpos = self.pos
		UIState.beginLayout(self)
Esempio n. 5
0
	def __exit__(self,exc_type,exc_value,traceback):
		UIState.endLayout()
		size = (self.maxsize[0],self.curpos[1]-self.pos[1])
		UIState.updateLayout(self.pos,size)
Esempio n. 6
0
	def __exit__(self,exc_type,exc_value,traceback):
		UIState.endLayout()
Esempio n. 7
0
	def __enter__(self):
		self.pos,self.size = UIState.doLayout(self.pos,self.size)
		self.calcGrid()
		UIState.beginLayout(self)