view gamelib/widgets.py @ 81:f4061568ea20

overlays for ajar and open door
author Adrianna Pińska <adrianna.pinska@gmail.com>
date Mon, 23 Aug 2010 23:03:45 +0200
parents d7c0a702a0b4
children d2f84f22def0
line wrap: on
line source

# widgets.py
# Copyright Boomslang team, 2010 (see COPYING File)

"""Custom Albow widgets"""

import albow.controls


class BoomLabel(albow.controls.Label):

    def set_margin(self, margin):
        """Add a set_margin method that recalculates the label size"""
        old_margin = self.margin
        w, h = self.size
        d = margin - old_margin
        self.margin = margin
        self.size = (w + 2 * d, h + 2 * d)