in gdscript (using godot 4.1.1 stable) i am working on a function that adds a checkbox dynamically works fine but when i try to get it to do something when it is toggled i get all sorts of errors this is my small function
func _on_add_left_button_pressed():
var checkbox = CheckBox.new()
var text = houseNum.text
leftList.add_child(checkbox)
checkbox.text = text
checkbox.connect("toggled", self, "_on_checkbox_toggled")
currently i have the "_on_checkbox_toggled"
defined above but it dosent do anything at the moment just has a print statement in it
the checkbox.connect
line gives me an error that says:
Invalid argument for "connect()" function: argument 2 should be "Callable" but is "res://main.gd"
any help would be much appreciated