-
So far my investigations have shown that multiple exports in a single slint! macro fail. Multiple slint! macros in main.rs also fail. Multiple compile statements in build.rs fail with multiple .slint files (only the last line is recognised). There is the example for todo but that only has a single export and wraps the dialog inside a popupWindow which I don't want unless that is the only way of getting a dialog. So is there code showing how to do this? Does #3217 work as it is still open. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
Multiple slint! macro in main.rs should in principle work. For example, this works fine:
It might be that in some case there could be duplicate symbols, then you can try to put the slint! macro in a module. Or why was it not working? |
Beta Was this translation helpful? Give feedback.
-
Hi Oliver, And because the component is not exported then that causes other problems. Of course they may be caused by the way I have structured it. I do think it is fair to say that multiple exported components, whether as multiple slint! or multiple slint files that are refered to by compile are not easy. And I would have thought this was fundamental functionality. If you wish I can set up a few gist to show the code approaches I gave taken. There is an excellent possibility I have completely misunderstood how to use the library. Regards, |
Beta Was this translation helpful? Give feedback.
-
Just tried running your code and it works. Changed one of the windows to a dialog and still worked. So I guess I am doing something wrong. |
Beta Was this translation helpful? Give feedback.
-
Here is the weird thing. Where has TextStyle come from? It is almost as though multiple simple slint! are allowed by multiple complex slint! are not. Another change. From above a "complex" dialog and a complex window gave the Textstyle error. But a sinple dialog and complex window worked. slint!{
} slint!{
} fn main() { And this does not work (replacing B) slint!{
} So adding either of the LineEdit or the buttons causes the error. If it is just the callback declaration and Text then works. |
Beta Was this translation helpful? Give feedback.
-
Hi Simon, |
Beta Was this translation helpful? Give feedback.
-
As I mentioned, this works for including the slint in the main file but how would I have multiple .slint files? |
Beta Was this translation helpful? Give feedback.
I think the
TextStyle
comes from within the style. Generally there's a chance that using multipleslint!
macros within the same module may produces clashes. I think it's better to use separate modules to avoid this: