flashing stops if clicked

This commit is contained in:
Fredrick W. Warren 2025-02-26 06:05:25 -07:00
parent 4d806fd859
commit 103177d79f

View File

@ -90,7 +90,10 @@ class Application(wmoo.Application):
ic("")
ic(f"sender: {sender}")
ic(f"message: {message}")
self._flasher = 7
if self.backlit:
self._flasher = 8
else:
self._flasher = 7
def handle_sent_im_msg(self, account, recepient, message):
"""
@ -154,6 +157,11 @@ class Application(wmoo.Application):
self.draw_background()
self.draw_all_text()
def backlight_off(self, event):
self._flasher = 0
if self.backlit:
self.toggle_backlight(True)
def update(self):
wmoo.Application.update(self)
@ -192,7 +200,7 @@ def main():
# 6x7 grey1=1 grey2=10 green1=18 green2=27
app.draw_background()
app.draw_all_text()
app.addCallback(app.toggle_backlight, 'buttonrelease', area=(2,2,62,62))
app.addCallback(app.backlight_off, 'buttonrelease', area=(2,2,62,62))
# Start the GLib main loop in a separate thread
glib_thread = threading.Thread(target=run_glib_mainloop, daemon=True)