setting an image inside widgets using a variable? any help?

So I have a variable that contains an image which I’m using to set an image object, this is the code:

capture 1

‘Image to change’ is the 2d texture variable that contains the image in question. ‘Expanded Image’ is a widget that contains the image to be updated. I bind ‘Selected image’ to the image brush so whenever it’s been set, it will update (this doesnt do anything though)

Capture2

anyone know why this isn’t working?

Thank you for any replies

Here’s the solution (given by @Chatouille in another question):

'You are calling ShowImage before creating the ExpandedImage widget, so in ShowImage the call to GetAllWidgetsOfClass finds nothing. You probably want to create the widget and set its SelectedImage variable, and THEN call ShowImage to add the widget into your box.

Instead of using GetAllWidgetsOfClass, you could add a parameter to your ShowImage function, and pass the created ExpandedImage widget through as parameter. This would be much proper’

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.