I’m starting my foray into Widgets with C++. I have a new UserWidget created with a simple Text widget that I have bound to my base class. This works very well as I can set the bound variable in my base and instantly see the binding in the widget.
The problems begin when I want to bind something like an Image. It appears that the Image widget is not directly bindable. So, in my base class I created a private UTexture2D property. I also created a public GetThumbnail() function that returns this property. In my UserWidget, I bound the Brush of the Image to a new Function called RetrieveThumbnail(). Inside of RetrieveThumbnial() I call the GetThumbnail() function from my base.
This all appears to be working fine, but how can I fire an event (or some other notification) so that my UserWidget knows that the image has changed?
For testing purposes to make sure that everything was working, I plugged in my RetrieveThumbnail() function to my Tick() in my UserWidget - and it works fine. Obviously this is not optimal and need a way to trigger an event when the image in the widget changes so I can update the image.