Simply changing:
get_node("ItemList1").connect("item_selected", self, "_on_ItemList_item_selected")
to:
ItemList1.connect("item_selected", self, "_on_ItemList_item_selected")
should work since the variable ItemList1
references the object you want to connect the signal from. The reason get_node()
doesn't work is because I believe add_child()
updates at the end of the frame so get_node()
wouldn't be able to find the new child until the next frame.