#Problem with finding a key in 'dictionary'.

2 messages · Page 1 of 1 (latest)

kindred sonnet
#

in _ready(), change this :
button.connect("pressed", Callable(self, "_on_button_pressed"))
to this (the 'bind' part is optional but needed for our situation)
button.pressed.connect(_on_button_pressed.bind(button))

then change _on_button_pressed like this :
func _on_button_pressed(button):
from there, you have access to your button 🙂 You likely also won't need to check if it's a button, too.

#

You may also want to use the actual button as a key to your dictionary, but it's up to you