How can I set StyleBox of an element using the StyleBox is .tres Theme object? (C#)

Godot Version

4.4.1.stable.mono

Question

I’m trying to set the StyleBox property of an element using custom property in a .tres file, but it doesn’t seems to work. I’ve tested a couple thing and I’m sure that:

  • terminalCommandPrompt did indeed linked to the intended Label node by the text changing when I intended it to in the code.
  • normal is the default StyleBox for the element.

If anyone know how I can fix this, please let me know. Thank you in advance!

Here’s the code I use to attempt to change the StyleBox property of the node:

terminalCommandPrompt.Text = "Hello world!" // Registered and visible to the screen.
terminalCommandPrompt.AddThemeStyleboxOverride("disabled", terminalCommandPrompt.GetThemeStylebox("disabled", "Label")); // Did not register the change
GD.Print(terminalCommandPrompt.GetThemeStylebox("disabled", "Label")); // <StyleBoxFlat#-9223372009759570601>
GD.Print(terminalCommandPrompt.HasThemeStylebox("disabled", "Label")); // True
GD.Print(terminalCommandPrompt.HasThemeStyleboxOverride("disabled")); // True


The StyleBox named disabled is the one I want to use