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)
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)
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)
def __enter__(self): self.pos,self.size = UIState.doLayout(self.pos,self.size) self.curpos = self.pos UIState.beginLayout(self)
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)
def __exit__(self,exc_type,exc_value,traceback): UIState.endLayout()
def __enter__(self): self.pos,self.size = UIState.doLayout(self.pos,self.size) self.calcGrid() UIState.beginLayout(self)