dymokomi/luced-message
Source of release 0.5.0
## luced-message's application: the window, its panels and their sources, and the
## timer that takes in what the sources' engines report.
from luce_ui.ui import Application, Font
from panels import Panels
import theme
from luce_std import crash
## The version crash reports carry; keep it equal to package.prisma's.
pub let version: str = "0.5.0"
pub class LuceMessage:
pub let app: Application
pub let panels: Panels
## The timer that takes in the sources' events: the window may be idle, with no
## frames drawn, while mail arrives.
let ticking: int
pub func init(self, directory: str = "") -> unit!:
crash.enable("luced-message", version)
let font = Font()
self.panels = Panels(font, directory)
self.app = Application(self.panels.body, title = "Luced Message", width = 1400, height = 860, theme = theme.editor_theme())
self.panels.app = self.app
self.panels.reader.app = self.app
self.panels.composer.app = self.app
self.app.set_commands(self.panels.actions.all)
self.app.set_error_handler(self.panels.tell)
self.ticking = self.app.every(0.1, func () -> unit!:
self.panels.poll())
pub func run(self, arguments: list[str]) -> unit!:
self.app.run(frame_limit = 3 if "--smoke" in arguments else 0)
pub func close(self):
self.app.cancel(self.ticking)
self.panels.close()
self.app.close()