Slint is a native GUI toolkit written in Rust, with APIs in Rust, C++,             Python, and JavaScript, designed for fast and responsi

Slint 1.8 Released with New Property Changed Callbacks, Timer, and Swipe Gesture

submited by
Style Pass
2024-09-23 15:30:03

Slint is a native GUI toolkit written in Rust, with APIs in Rust, C++, Python, and JavaScript, designed for fast and responsive applications on all platforms.
Today, we've released 1.8! This version brings several much requested features. Property change callbacks. Timer and SwipeGestureHandler elements. Improvements to the live-preview and vscode extension. Cross platform binary packages. Templates for more embedded boards. Math gains postfix support and atan2.

Property bindings are part of how you can achieve a lot with so little code in Slint. Then many elements have callbacks to help manage side effects. Take TextEdit and the edited call back to let you react to the changing text the user is being entered. However you quickly find places where your UI is updating and changing, but unlike TextEdit there is no callback to use. Enter Property Change Callbacks. They can help you make your interface even more dynamic without having to write extra business side logic.
Let's imagine TextEdit didn't have an edited callback. You can create the same behavior as follows:

This callback is triggered when the text property of the TextEdit changes, updating the text in the second Text element accordingly.
They also can be used to help you debug your bindings.

Leave a Comment