def __init__(self, text, position=None, size=1, name='Button'): if position is None: position = P2(-.95, g.nextNW2dY) g.nextNW2dY = g.nextNW2dY - .1 Handle.__init__(self, name=name) self.__dict__['click'] = EventMonitor(self.name) self.d.model = DirectButton(text=text, pos=(position.x, 0, position.y), scale=size * 0.1, command=lambda: postEvent(self.name))
def __init__(self, items, position=None, size=1, name='Menu'): Handle.__init__(self, name=name) self.__dict__['select'] = EventMonitor(self.name) if position is None: pos = (.95, 0, g.nextNE2dY) g.nextNE2dY = g.nextNE2dY - .1 self.d.model = DirectOptionMenu( pos=(position.x, 0, position.y), scale=size * 0.15, items=items, command=lambda v: postEvent(self.name, v))
def textBoxChange(v, self): postEvent(self.name, v) self.__dict__['text'].set(v)
def __init__(self, text, position = None, size = 1, name = 'Button'): if position is None: position = P2(-.95, g.nextNW2dY) g.nextNW2dY = g.nextNW2dY -.1 Handle.__init__(self, name = name) self.__dict__['click'] = EventMonitor(self.name) self.d.model = DirectButton(text = text, pos = (position.x, 0, position.y), scale = size*0.1, command = lambda: postEvent(self.name))
def __init__(self, items, position = None, size = 1, name = 'Menu'): Handle.__init__(self, name = name) self.__dict__['select'] = EventMonitor(self.name) if position is None: pos = (.95, 0, g.nextNE2dY) g.nextNE2dY = g.nextNE2dY - .1 self.d.model = DirectOptionMenu(pos = (position.x,0,position.y),scale=size*0.15,items=items, command=lambda v: postEvent(self.name, v))