mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-04 01:20:37 +00:00
Add show/hide/run to component instance
This commit is contained in:
parent
644ebbb2aa
commit
82c2728cfd
1 changed files with 17 additions and 1 deletions
|
@ -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()?)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue