mirror of
https://github.com/jtgans/g13gui.git
synced 2025-06-20 00:14:09 -04:00
The whole project at this point is entirely python, with no g13d present anywhere, so let's clean up the tree somewhat and make it flatter.
18 lines
540 B
Python
18 lines
540 B
Python
from g13gui.bitwidgets.widget import Widget
|
|
|
|
|
|
class Rectangle(Widget):
|
|
def __init__(self, x, y, w, h, fill=True):
|
|
Widget.__init__(self)
|
|
self.position = (x, y)
|
|
self.bounds = (w, h)
|
|
self.fill = fill
|
|
|
|
def draw(self, ctx):
|
|
if self._visible:
|
|
points = (self._position[0], self._position[1],
|
|
self._position[0] + self._bounds[0],
|
|
self._position[1] + self._bounds[1])
|
|
ctx.rectangle(points,
|
|
fill=self._fill)
|