Add show/hide/run to component instance

This commit is contained in:
Simon Hausmann 2023-12-13 23:58:53 +01:00 committed by Simon Hausmann
parent 644ebbb2aa
commit 82c2728cfd

View file

@ -4,11 +4,15 @@
use std::collections::HashMap;
use std::path::PathBuf;
use slint_interpreter::ComponentHandle;
use indexmap::IndexMap;
use pyo3::prelude::*;
use pyo3::types::PyTuple;
use crate::errors::{PyGetPropertyError, PyInvokeError, PySetCallbackError, PySetPropertyError};
use crate::errors::{
PyGetPropertyError, PyInvokeError, PyPlatformError, PySetCallbackError, PySetPropertyError,
};
use crate::value::PyValue;
#[pyclass(unsendable)]
@ -307,4 +311,16 @@ impl ComponentInstance {
})?
.into())
}
fn show(&self) -> Result<(), PyPlatformError> {
Ok(self.instance.show()?)
}
fn hide(&self) -> Result<(), PyPlatformError> {
Ok(self.instance.hide()?)
}
fn run(&self) -> Result<(), PyPlatformError> {
Ok(self.instance.run()?)
}
}