Replies: 1 comment 1 reply
-
@antis81 I was also expecting something similar to that. If a component is inheriting another, I would expect to have access to its "methods" / callbacks somehow, without needing to resort to globals. For now, the only way I have found is to declare such things in an exported // file: base.slint
export global MyWindowGlobals {
callback rejected();
}
export MyWindow inherits Window {
// some code
// use rejected whenever it's needed with MyWindowGlobals.rejected();
}
// file: application-foo.slint
import { MyWindow } from "base.slint";
export { MyWindowGlobals } from "base.slint";
export ApplicationFooWindow inherits MyWindow {} And then, in the backend, you can access and call the callback stored in the given globals as explained in the documentation. So, for now, it seems the only options are to either declare lots of globals across files or create a single |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The context (use case) for my question is a (C++/CMake) Project that generates multilple executable targets.
Both applications have some common behaviour (e.g. a product-version, accepted, rejected, get_theme_icon, …).
I am looking for something in the fashion of a "super" function (maybe
super<Type>()
in backend) in addition to thewindow()
function.Is there a way to access the "rejected" callback from the backend with current Slint version (1.12.1)?
Beta Was this translation helpful? Give feedback.
All reactions