Replies: 1 comment 3 replies
-
You can create a callback alias, but it needs to be done the other way around and without parenthesis:
I'm still a bit new to Slint so I may be wrong, but I believe a callback is not to be confused with a signal. So you can't "connect" to a callback, you can only set one handler for it, and it needs to be done at the instantiation. Since a global gets instantiated implicitly, I think you can only set the handler for its callbacks through the API. I've tried to re-export a global callback in SlintPad to see if this would allow defining a handler in Slint, but while the example compiled, the callback handler does not appear to work. I wonder if this is a bug or whether there is a reason why that can't work, or whether I made a mistake of course. (edit: well I guess the reason is kind of obvious... if that would actually work, it would allow possibly defining multiple handlers and there would be no clear way of choosing which one should be used) (edit2: though... the same is actually true for callback aliases in general, and when creating multiple aliases to a regular callback it just seems to be kind of arbitrary, which one will actually fire) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When using callbacks I found that sometimes it is hard to use them and I need to use workarounds
is this possible?
Now I need to use (with more variables in callback this is more problematic)
Beta Was this translation helpful? Give feedback.
All reactions