I’m adding a UIMage to the WidgetTree RootWidget for a custom cursor class using UUserWidget. While this works and the design view show the image the Hierarchy view that lists the widgets continues to show the Canvas panel that is automatically added.
In the UMGEditor the hierarcy view is managed by a WidgetTreeView but I can’t tell how to tell it to update it’s view of the items in the UUserWidget.
Sorry to revive the thread after so long, but I stumbled upon it when I was looking for an answer for the same issue so it might be worth finally answering it after I sorted it out for myself.
It was easier to understand after reading this article from Ben’s UI:
Basically I believe in order for the changes to be propagated correctly you will need to do several things:
Get a reference to the Widget Blueprint as this is what you will need to be modifying:
To propagate all of the changes so they do not get lost you will need to mark all of the assets that have been modified as “dirty” using Modify() and mark the blueprint as structurally modified: