TabWidget - Tab callback to update contents #3001
-
I am trying to make a simple application that has a few tabs. Each tab displays some information retrieved from a web service. I've been looking through the documentation and examples but couldn't find anything. Maybe there is another way to achieve this that I am not thinking of? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
There is currently no such callback. In the mean time, there is a workaround to simulate change events with #112 (comment) |
Beta Was this translation helpful? Give feedback.
-
It probably would be useful to have such a callback. I am coming from the Java/JavaFX world and there you can add event listeners to almost all properties. This is super powerful but you can also easily shoot yourself in the foot with them. I tried to implement the workaround from the linked comment but can't get it to work. With this .slint-Code I get the "impure callback" error:
While the older syntax to define components only gives a warning:
|
Beta Was this translation helpful? Give feedback.
I believe you just need to mark the callback as pure as below: