I have a pesky problem with the Checkbox. Everytime I code CheckBox.Pressed = true, the Pressed event is fired. I simply want the appearance to change without triggering the on_CheckBox_pressed() event. Is there a way to do this?

That may work but seems cumbersome. Any other ideas?

You could add a bool variable, for example "pressed_via_code", and set it to true right before setting CheckBox.Pressed = true. Then you'd be able to check this bool within your event.

func _on_CheckBox_pressed():
	if pressed_via_code:
		pressed_via_code = false
		return
	else:
	 	do_stuff()

Of course this will only work if you have the bool and the event within the same script. Otherwise you'll need a reference/connection to the corresponding script.

9 days later
2 years later
5 months later

in Godot4 at least : checkbox.set_pressed_no_signal(your_bool_value)