![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | wyattb |
I have two LineEdit Controls (FireValue
and FireStart
) and want to get the value when FireValue
changes into FireStart
. I want to use Signals to do this. I want to keep my code organized so that FireValue
does an emit_signal()
and FireStart
does the connect()
and callback _set_fire()
.
Why doesn’t the callback _set_fire()
receive the signal when focus is exited in FireValue?
I know it works if I put all the code in Control1.gd but why does it not work when I have the split? Here is the code. Tested on both 3.1 and 3.2 Mac OS X.
#FireValue.gd
extends LineEdit
signal fire
func _ready():
pass
func _on_FireValue_focus_exited(extra_arg_0: String) -> void:
emit_signal("fire",self.text)
pass # Replace with function body.
#FireStart.gd
extends LineEdit
signal fire
func _ready():
connect("fire",self,"_set_fire")
pass
func _set_fire(s):
self.text=s
pass
Project Screen shot