source: nagslang/widgets/base.py@ 689:45d2a6aef3a4

Last change on this file since 689:45d2a6aef3a4 was 689:45d2a6aef3a4, checked in by Neil Muller <drnlmuller@…>, 2 years ago

Some flake8 fixes

File size: 494 bytes
Line 
1import pygame
2
3
4class Widget(object):
5 def __init__(self, pos, size):
6 self.pos = pos
7 self.size = size
8 self.rect = pygame.Rect(pos, size if size else (0, 0))
9 self.visible = True
10 self.is_prepared = False
11
12 def draw(self, surface):
13 raise NotImplementedError()
14
15 def prepare(self):
16 raise NotImplementedError()
17
18 def do_prepare(self):
19 if not self.is_prepared:
20 self.prepare()
21 self.is_prepared = True
Note: See TracBrowser for help on using the repository browser.