#FileDialog.connect clarification

3 messages · Page 1 of 1 (latest)

elder wind
#

Just a short bit of clarification I hope. I want to spawn a FileDialog via code and send the selection data back to the node that spawned it. I have not tried it yet out of an abundance of caution. Here is the code I have:

dialog.connect("file_selected", self, "db_file_selected", [dialog.path])

Then under the defined function I have:

func db_file_selected(path): ...

Is this how I'm supposed to pass this information via the signals, especially the dialog.path portion of the connect() call?

chrome rock
#

since the signal sends the path automatically you don't have to bind anything
dialog.connect("file_selected", self, "db_file_selected")

rugged scaffold
#

or even better and type safe: dialog.file_selected.connect(db_file_selected) 🙂