-
I'm still not quite sure what's the difference between
But both of them seems to be returning const myVar = Variable(0);
myVar.connect("changed", (self) => print(self.value));
const myButton = Widget.Button();
myButton.connect("clicked", (self) => print(self.action_name));
const myButton = Widget.Button();
myButton.on("clicked", (self) => print(self.action_name)); |
Beta Was this translation helpful? Give feedback.
Answered by
Aylur
Feb 11, 2024
Replies: 1 comment 3 replies
-
const widget = Widget.Button()
const onReturn = widget.on("clicked", () => print("clicked"))
const connectReturn = widget.connect("clicked", () => print("clicked"))
onReturn === widget // true
typeof connectReturn // number
widget.disconnect(connectReturn) // used to disconnect |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yes,
.on()
just calls.connect
with the same parameters actually