Ejemplo n.º 1
0
class SbMask(SbItem):
    """StaticText to show whether mask is activated."""

    def __init__(self, mapframe, statusbar, position=0):
        SbItem.__init__(self, mapframe, statusbar, position)
        self.name = "mask"

        self.widget = StaticText(parent=self.statusbar, id=wx.ID_ANY, label=_("MASK"))
        self.widget.SetForegroundColour(wx.Colour(255, 0, 0))
        self.widget.Hide()

    def Update(self):
        if grass.find_file(
            name="MASK", element="cell", mapset=grass.gisenv()["MAPSET"]
        )["name"]:
            self.Show()
        else:
            self.Hide()