Add support for timers and run/quit_event_loop

This commit is contained in:
Simon Hausmann 2023-12-14 17:31:09 +01:00 committed by Simon Hausmann
parent ebaecbcb7e
commit 33a1d07226
5 changed files with 148 additions and 1 deletions

View file

@ -45,6 +45,20 @@ impl From<slint_interpreter::PlatformError> for PyPlatformError {
}
}
pub struct PyEventLoopError(pub slint_interpreter::EventLoopError);
impl From<PyEventLoopError> for PyErr {
fn from(err: PyEventLoopError) -> Self {
pyo3::exceptions::PyRuntimeError::new_err(err.0.to_string())
}
}
impl From<slint_interpreter::EventLoopError> for PyEventLoopError {
fn from(err: slint_interpreter::EventLoopError) -> Self {
Self(err)
}
}
pub struct PyInvokeError(pub slint_interpreter::InvokeError);
impl From<PyInvokeError> for PyErr {