Unable to set textures to procedurally generated Texture Buttons

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Dalex
:warning: Old Version Published before Godot 3 was released.

Hello, could anyone help me out with texture buttons
Basically I am trying to set textures to Texture Buttons with a script
The function attached to the TextureButtons is the following:

func set_texture_from_path(image_path):
    if image_path == "":
	    return
    set_normal_texture(load(image_path))
    adjust_texture_size() #sets the texture to the wanted size

But when running the code, the textures do not show up even though I am 100% sure the function above is called for each button with the correct image path.

:bust_in_silhouette: Reply From: Dalex

Okay, so what I was doing wrong was that I was setting the texture AFTER adding the instanced node as a child.