Also, how do you handle trying to call a `@Composa...
# compose-desktop
k
Also, how do you handle trying to call a
@Composable
function from a
Window()
's
MenuBar
??? I can't do it from a
Window
in the
main
function, as that can't be
@Composable
, and a
@Composable
can't be called from anything but a
@Composable
? But a
Window
in a
@Composable
function still can't seem to do it! Sorry! Thanks! 🥴
m
I believe your thinking is wrong here. You should call a normal function which triggers some state change in your model to which your composable functions then can react to.
k
Haha! I've been reading up on the new Thinking in Compose docs etc, and still must've missed something! Well, a lot really maybe... Thanks for your attention. I might just have to do some more reading. Can you give me a pointer where I can find the right way to make my @Composable functions react to stuff properly? Thanks! ☺️
OK................. I think I might've finally got it! I had been using
remember
from habit, because of simple examples I've been building on, and my simple app had been able to handle that obviously! I've now got things working I think, using just
var dataIn = mutableStateOf("")
for example, and my @Composables seem to be updating live when it changes???? Hopefully this is right! Gee, what a learning experience. Thanks anyway!!
And the
remember
idea might help me with another problem I was having, where I wanted a variable to be set/copied from another variable, but then remain unchanged as the original one varied!!? Wow. Good stuff. @darkmoon_uk will be proud of me, if I can get this into my head! This might've been worth staying up late for, if I can have learnt this!!!
z
k
Thank you very much!! That looks very helpful. Will read more later. 😎👍