Updating Slate UI Layout On Click (Plugin code)
I've been trying to implement the UI for a plugin I'm making using Slate. However, I haven't been able to figure out how I can change the layout itself when a button is clicked. Since the button click should change the layout itself, I imagine there is a way to redraw the UI on demand, but I don't know how to do it.
In OnSpawnPluginTab, I bind a lambda expression to my button click. The expression simply turns a boolean flag to true (initially false). SpawnFLVBox() is the layout segment that I want to change. The code for it follows.
We can see in SpawnFLVBox that I simply check the flag, and draw 2 editable text boxes instead of 3 if the flag is true. However, when I click the button, the layout is not re-drawn, which makes sense because OnSpawnPluginTab is only called at the beginning. So my question is: how do I request a UI re-draw? How do I refresh the view? I seem to understand that Slate doesn't work by updating the UI every frame. But then I don't know what to do to solve my problem. Any help would be greatly appreciated.
asked Feb 19 '19 at 03:46 PM in C++ Programming
answered Feb 19 '19 at 11:45 PM
Jamie Dale STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here