Mercurial > boomslang
comparison pyntnclick/tools/rect_drawer.py @ 698:1e54c6966666 pyntnclick
Mode label updates again
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Tue, 14 Feb 2012 17:13:22 +0200 |
parents | 4bf13af26d6a |
children | 8edd7b52423a |
comparison
equal
deleted
inserted
replaced
697:4bf13af26d6a | 698:1e54c6966666 |
---|---|
523 self.app_image = app_image | 523 self.app_image = app_image |
524 super(ModeLabel, self).__init__(rect, | 524 super(ModeLabel, self).__init__(rect, |
525 gd, 'Mode : ', fontname=constants.bold_font, | 525 gd, 'Mode : ', fontname=constants.bold_font, |
526 fontsize=15, color=pygame.color.Color(128, 0, 255)) | 526 fontsize=15, color=pygame.color.Color(128, 0, 255)) |
527 | 527 |
528 def draw_all(self, surface): | 528 |
529 self.set_text('Mode : %s' % self.app_image.mode) | 529 def draw(self, surface): |
530 super(ModeLabel, self).draw_all(surface) | 530 text = 'Mode : %s' % self.app_image.mode |
531 if self.text != text: | |
532 self.text = text | |
533 self.prepare() | |
534 super(ModeLabel, self).draw(surface) | |
531 | 535 |
532 | 536 |
533 def make_button(text, gd, action, ypos): | 537 def make_button(text, gd, action, ypos): |
534 rect = pygame.rect.Rect(0, 0, constants.menu_width, | 538 rect = pygame.rect.Rect(0, 0, constants.menu_width, |
535 constants.menu_button_height) | 539 constants.menu_button_height) |