-
I am under the impression that I can get a property using
Emits following error
How do I access the PS: This is a MWE. I have a beautiful GUI almost done using slint. I need to set the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Only the property declared in the last element of the .slint are exposed. The property of the window are actually not exposed. We would like to extend the native window API so we can query that in native code (see #323 and #333 ) In the mean time, you can re-export the properties using something like use slint;
slint::slint!{
HelloWorld := Window {
width: 100px;
height: 100px;
// ###### added these two lines to re-export the size
property window_width <=> width;
property window_height <=> height;
Text {
text: "hello world";
color: green;
}
}
}
fn main() {
let win = HelloWorld::new();
// ### used get_window_width()
println!("width of window is {}", win.get_window_width());
win.run();
} |
Beta Was this translation helpful? Give feedback.
Only the property declared in the last element of the .slint are exposed.
The property of the window are actually not exposed.
We would like to extend the native window API so we can query that in native code (see #323 and #333 )
In the mean time, you can re-export the properties using something like