Beispiel #1
0
 def __init__(self, choices, cancel_allowed=False):
     texts, max_leng = self.create_buttons(choices)
     w = max(240, max_leng + 2*self.offsettext)
     h = len(choices) * self.lineheight
     WindowUser.__init__(self, w, h)
     self.draw_buttons(texts)
     self.cancel_allowed = cancel_allowed
     self.index = 0
Beispiel #2
0
 def update(self, event):
     result = WindowUser.update(self, event)
     if result != None:
         pygame.event.clear()
         if result:
             return self.widget.text
         else:
             return ""
     else:
         self.widget.update(event)
         return None
Beispiel #3
0
 def __init__(self, datamap):
     w, h = 400, 400
     WindowUser.__init__(self, w, h)
     self.create_valid_cancel()
     self.data = datamap
     self.add_widgets()
Beispiel #4
0
 def __init__(self, text):
     WindowUser.__init__(self, 240, 90)
     self.create_valid_cancel()
     self.draw_text(text)
Beispiel #5
0
 def draw(self, surf):
     self.widget.draw(self.contents)
     WindowUser.draw(self, surf)
Beispiel #6
0
 def __init__(self, text=""):
     WindowUser.__init__(self, 440, 90)
     self.create_cadre_text(text)
     self.create_valid_cancel()