Guest User

Untitled

a guest
May 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. # cdieview.py
  2. # Implementation of a DieView with changeable forground color
  3. # Illustrates inheritance
  4.  
  5. from dieview import DieView
  6.  
  7. class ColorDieView(DieView):
  8.  
  9. def setValue(self, value):
  10. self.value = value # remember this value
  11. DieView.setValue(self, value) # call setValue from parent class
  12.  
  13. def setColor(self, color):
  14. self.foreground = color
  15. self.setValue(self.value)
Add Comment
Please, Sign In to add comment