-
This code does not produce the desired result:
The text "Button clicked" does appear in the terminal. However x is not printed. First of all, is anything like this possiblle in fyne? If so, any suggestions as how to make this work would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This is the reason you do not see anything. At the moment |
Beta Was this translation helpful? Give feedback.
-
@faide is correct, the button callback happens when the user clicks it. |
Beta Was this translation helpful? Give feedback.
fmt.Println(x)
is executed before your callback function is called (when the button is actually pressed by a user).This is the reason you do not see anything. At the moment
fmt.Println(x)
is executedx
is still equal to its initial value of""