view gamelib/widgets.py @ 99:367b1c9c3c6d

Restore mouse when returning to main menu
author Neil Muller <neil@dip.sun.ac.za>
date Tue, 24 Aug 2010 08:16:56 +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)