Is there something similar to this?

var lb = Label.new()
lb.onclick = Abc
func Abc():
  # do something
  • extends Node2D
    
    func _ready():
    	var label = Label.new()
    	label.text = "Hi, I am Godot"
    	label.mouse_filter = Control.MOUSE_FILTER_PASS
    	label.rect_position = Vector2(100, 100)
    	label.connect("gui_input", self, "label_input")
    	add_child(label)
    	
    func label_input(event):
    	if event is InputEventMouseButton and event.pressed:
    		print("clicked on label")
extends Node2D

func _ready():
	var label = Label.new()
	label.text = "Hi, I am Godot"
	label.mouse_filter = Control.MOUSE_FILTER_PASS
	label.rect_position = Vector2(100, 100)
	label.connect("gui_input", self, "label_input")
	add_child(label)
	
func label_input(event):
	if event is InputEventMouseButton and event.pressed:
		print("clicked on label")