widgets: Further compact some of the internal representations
Many widgets adopted the _im(mutable) idiom to allow us to reduce the RAM overhead of each widget. Where the immutable data considers entirely of integers smaller than 256 then we can push this just a little further by switching from a tuple to a bytes. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
parent
9099c2398e
commit
ae0d59dbe3
1 changed files with 2 additions and 2 deletions
|
@ -305,7 +305,7 @@ class Checkbox():
|
||||||
class GfxButton():
|
class GfxButton():
|
||||||
"""A button with a graphical icon."""
|
"""A button with a graphical icon."""
|
||||||
def __init__(self, x, y, gfx):
|
def __init__(self, x, y, gfx):
|
||||||
self._im = (x, y)
|
self._im = bytes((x, y))
|
||||||
self.gfx = gfx
|
self.gfx = gfx
|
||||||
|
|
||||||
def draw(self):
|
def draw(self):
|
||||||
|
@ -410,7 +410,7 @@ class Spinner():
|
||||||
widget and requires 60x120 px.
|
widget and requires 60x120 px.
|
||||||
"""
|
"""
|
||||||
def __init__(self, x, y, mn, mx, field=1):
|
def __init__(self, x, y, mn, mx, field=1):
|
||||||
self._im = (x, y, mn, mx, field)
|
self._im = bytes((x, y, mn, mx, field))
|
||||||
self.value = mn
|
self.value = mn
|
||||||
|
|
||||||
def draw(self):
|
def draw(self):
|
||||||
|
|
Loading…
Reference in a new issue